This example demonstrates how to add events to the default bus and a custom bus and how to trigger event rules.
De-coupling microservices using the AWS EventBridge service
npm i -g serverless
npm i
sls deploycurl -X POST -H "Content-Type:application/json" https://XXXXXXX.execute-api.us-east-1.amazonaws.com/alice
--data '{ "messageSentToAlice": "Learn Serverless" }'Example Result:
{"message":"Alice was called"}Alice leaves an event on a custom bus. Bob is listening for events that Alice creates.
Dave is a schedule cron Lambda that runs every 10 minutes. Dave picks a random number between 1 and 151 and fetches the Pokemon from PokeAPI for that random number.
Eve has lots of rules she is listening for on the default EventBridge bus including scheduled events like Dave.
This example if a combination of lessons learned from Phillip Muns blog: https://www.serverless.com/blog/eventbridge-use-cases-and-tutorial/
and Marcia Villalba YouTube video: https://www.youtube.com/watch?v=VYtBXdf53b4