I am new to event bus service within AWS.
I am trying to send a event back to event bus using boto3 library.
for some reason I am not finding any logs in cloud watch with respect to the event of event bridge.
Here is what i am trying out:
def handler(event, context):
event_client = boto3.client('events')
response = event_client.put_events(
Entries=[
{
'Source': 'Lambda function get_distance_duration_from_bsig_file',
'DetailType': 'Distance and Duration calculated by bsig file',
'Detail': json.dumps(event),
'EventBusName': 'workflow-notifications-bus'
},
]
)
In 'Detail'
I am sending in the event that i am getting in from lambda event.
Is there anything that i am missing out?
Also here is the response from put_events
{
"FailedEntryCount": 0,
"Entries": [
{
"EventId": "07f05db5-da9f-74a2-0b81-55c5088895bd"
}
],
"ResponseMetadata": {
"RequestId": "8d5adc18-6829-478f-8c20-4876bf723f52",
"HTTPStatusCode": 200,
"HTTPHeaders": {
"x-amzn-requestid": "8d5adc18-6829-478f-8c20-4876bf723f52",
"content-type": "application/x-amz-json-1.1",
"content-length": "85",
"date": "Wed, 12 Apr 2023 04:40:28 GMT"
},
"RetryAttempts": 0
}
}
2
Answers
Since you are getting an EventId, your event was sent successfully. If you want to see it in CloudWatch Logs, you will need to add a Rule to EventBridge with a CloudWatch Log Group as the target.
Or you should be able to see the event in CloudTrail (different from Cloudwatch Logs) as described here.
This can also happen as result of https://github.com/aws/aws-sdk/issues/186
where putting an event on a non-existent bus will still return a "successful" response.