in source/lib/events.py [0:0]
def add_target(self, lambda_function_name, event):
try:
json_event = dumps(event, indent=4, cls=DateTimeEncoder)
response = cwe_client.put_targets(
Rule=self.rule_name,
Targets=[
{
'Id': self.target_id,
'Arn': self.get_lambda_arn(lambda_function_name),
'Input': json_event
},
]
)
return response
except Exception as e:
self.logger.error("unhandled exception: CloudWatchEvent_add_target", exc_info=1)