Skip to content

Event driven app that mirrors order processing in a brew bar based on AWS resources managed via terraform

License

Notifications You must be signed in to change notification settings

hemantksingh/brew-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brew-bar

Event driven app that mirrors order processing in a brew bar based on AWS resources managed via terraform

  • Public gateway used for providing public access for placing Orders, can also plug in to an identity provider for authorizing clients/users.
  • To enable clients to register events without changing backend code, you can send client events to EventBridge via an API Gateway
  • The internal AWS API Gateway performs validation on published events. It supports Draft 4 of JSON Schema and plug the schema into an API endpoint in order to reject any requests that don’t conform to the schema.
  • The event bus has a rule to dispatch order events to the delivery lambda. You can only create scheduled rules using the default event bus
  • EventBridge has a hard limit on the event size at 265 KB

Build the apps (lambda functions)

The apps are built using esbuild and packaged with zip as detailed here

make build APP=orders
make build APP=delivery

Deploy the stack

The infrastructure and apps are deployed using terraform

# Provision the stack
make stack APPLY=true

# Tear down
make destroy-stack

Get orders

cd provisioning
curl "$(terraform output -raw orders_api_url)/orders"

Run load tests

  • Pre requisites - Install pipenv

    python3 -m pip install --user pipenv
  • Run load test

    # get ORDERS_API_ID by loading terraform output
    make output
    
    # Terraform out put looks like:
    # orders_api_url = "https://e60e2y07o4.execute-api.eu-west-1.amazonaws.com/brewbar
    
    # run the load test
    make loadtest ORDERS_API_ID=e60e2y07o4

About

Event driven app that mirrors order processing in a brew bar based on AWS resources managed via terraform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages