A simple microservice application using AWS SAM, that uses Amazon EventBridge as at messaging between microservices.
Table of Contents
This project has a simple application where you can send food orders to different restaurants based on an API Request. And using EventBridge each restaurant will recieve the right order. You can extend this just by adding more restaurants microservice. Each restaurant is in control of their EventBridge rule, in this way we keep the whole application very decoupled. Also is used a microservice for send food orders to API Destination and control when events can't delivery, through a DLQ Dead Letter Queue for process the message later saving to DynamoDB Table.
You will need to deploy each microservice individually - orderManager, pizzaHat and Thailand.
Also the microservice blueDragon for show API Destinations with the site https://webhook.site/
We will be using AWS SAM and make sure you are running the latest version - at the time of writing, this was 1.78.0 (sam --version).
Deploy the project to the cloud:
sam deploy --guided
When asked about functions that may not have authorization defined, answer (y)es. The access to those functions will be open to anyone, so keep the app deployed only for the time you need this demo running.
Next times, when you update the code, you can build and deploy with:
sam deploy
To delete the app:
sam delete
- Amazon EventBridge
- Amazon API Gateway
- AWS Lambda
- AWS SAM
- AWS SDK Python
- Amazon SQS
- Amazon DynamoDB
- Amazon CloudWatch
My favorite resources used: