- Newest
- Most votes
- Most comments
First of all, with your code
client = boto3.client('events')
response = client.create_event_bus(
you are accessing the CloudWatchEvents, not AWS EventBridge (as the error message states - reason why is stated below).
"CloudWatchEvents' object has no attribute 'create_event_bus'"
Moreover, EventBridge isn't available in the Python and JS lambda environment yet (via default packages). I assume AWS has not the latest version of their SDK running in lambda, you could upload your own code as a bundle bundle or work with lambda layers and install your custom NPM dependencies (assuming you will run it as JS). That way you could install the latest SDK version of AWS (NPM) and use EventBridge (EventBridge was announced one month ago).
Furthermore if you take a look a the boto3 documentation https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/events.html#eventbridge, it states that it is (as of now) version 1.9.205 (see also the /api/latest/ in the URL).
If you open up the documentation for 1.9.42, the version you added to your report (I assume you got this out of the lambda), via this URL, https://boto3.amazonaws.com/v1/documentation/api/1.9.42/reference/services/events.html#eventbridge , you will see that the version 1.9.42 does not have EventBridge implemented.
It only features CloudWatchEvents and that's why you can only access EventBridge with boto3 (as of now). You have to wait until AWS updates the boto3 version on lambda's or you have to manually deploy your bundle and run it.
Edited by: MartinJK on Aug 12, 2019 10:06 AM
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- How can I use a Lambda function to automatically start an AWS Glue job when a crawler run completes?AWS OFFICIALUpdated 2 years ago