I played around with AWS a little bit and ended up at AWS EventBridge. I tried to write a Lambda for testing and understanding, but got an error just at the beginning.
import json, boto3
def lambda_handler(event, context):
client = boto3.client('events')
response = client.create_event_bus(
Name='TestEventBus',
EventSourceName='SomeSoucreEvent'
)
return {
'statusCode': 200,
'body': json.dumps(response)
}
I get the following error message:
Response: { "errorMessage": "'CloudWatchEvents' object has no attribute 'create_event_bus'", "errorType": "AttributeError", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 5, in lambda_handler\n response = client.create_event_bus(\n", " File \"/var/runtime/botocore/client.py\", line 563, in getattr\n self.class.name, item)\n" ] }
The version of Boto running in the Lambda is 1.9.42