- Overview
- Prerequisites
- Deployment Steps
- Deployment Validation
- Running the Guidance
- Next Steps
- Cleanup
- Notices
This application demonstrates how to build an event-driven, serverless sportsbook application on AWS to help betting and gambling operators effectively handle spiky and seasonal traffic. Using microservices and serverless computing, the application shows operators how to overcome the scaling limitations of traditional sportsbook applications. Each microservice has its own documentation that provides more details about its purpose, architecture, and implementation.
NOTE: This guidance demonstrates an architectural pattern. The application is not production ready in its current state.
Select a link from the following list to learn more about the microservice.
- Auth Service - Handles user authentication and authorization
- Betting Service - Manages betting operations
- GraphQL Service - Provides the GraphQL API layer
- Live Market Service - Handles live market data
- Sporting Events Service - Manages sporting event data
- System Events Service - Handles system-wide events
- Third Party Service - Integrates with third-party providers
- Trading Service - Manages trading operations
- User Service - Handles user management
- Wallet Service - Manages user wallet operations
You are responsible for the cost of the AWS services used while running this Guidance. As of August 2025, the cost for running this Guidance with the default settings in AWS Region US EAST 1 (N. Virginia) is approximately $16.70 per month for processing 1200 bets daily. This value will not scale linearly because of volume based pricing used by some AWS services used for the sportsbook application.
The following table provides a sample cost breakdown for deploying this Guidance with the default parameters in the US East (N. Virginia) Region for one month assuming non-production traffic volumes.
| AWS service | Dimensions | Cost [USD] |
|---|---|---|
| AWS AppSync | 950,000 API requests per month | $ 3.80 |
| Amazon Cognito | 50 active user per month without advanced security feature | $ 2.50 |
| Amazon SQS | 4,130,000 standard queue requests per month | $ 1.65 |
| Amazon DynamoDB | 5 GB storage, 2,525,000 write requests, 2,533,000 read requests per month | $ 4.57 |
| AWS Lambda | 4,500,000 requests per month with 200 ms average duration, 256 MB memory, 512 ephemeral storage | $ 0.70 |
| AWS Step Functions | 72000 workflow requests per month with 1 state transitions per workflow | $ 1.70 |
| Amazon EventBridge | 3,570,000 invocations, 1,785,000 events ingested, 1,785,000 events delivered per month | $ 1.78 |
These deployment instructions are optimized to best work on a Linux based system. Deployment to other operating systems may require additional steps.
The following tools are required to install the sample application.
- AWS CLI >= 2.15
- AWS SAM CLI >= 1.136
- NodeJS >= 22.18
- Python >= 3.12
-
Clone the repo using command.
git clone https://github.com/aws-solutions-library-samples/guidance-for-building-an-event-driven-sportsbook-on-aws.git event-driven-sportsbook
-
Change directory to the repository folder.
cd event-driven-sportsbook -
Initialise a Python virtual environment.
python3 -m venv .venv
-
Activate the virtual environment.
source .venv/bin/activate -
Install the required Python libraries to the virtual environment.
python3 -m pip install -r requirements.txt
-
Build and deploy the microservices.
sam build sam deploy --guided --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM
-
Provide a value for the
Stack NameandAWS Regionwhen you are prompted by the guided deployment process.Stack Name- Description: The name of the Cloudformation application stack.
- Example:
sportsbook
AWS Region- Description: The AWS region where the application will be deployed.
- Example:
eu-west-2
-
Accept the default values for the following parameters.
EventBusNameAccessLogsBucketCognitoAdvancedSecurityGeoRestrictiontypeGeoRestrictionLocationDomainNameCertificateArn
-
Install the web application npm dependencies.
npm install -
Update the web application configuration, then build and deploy the web application.
npm run config npm run build npm run deploy
[!TIP] In order, these commands:
- Generates a
.env.localfile with stack outputs from the infrastructure build - Builds the frontend application
- Copies the application build to the s3 bucket that CloudFront points at
- Generates a
- Using the AWS Management Console, open CloudFormation and verify that the sportsbook CloudFormation stack was successfully deployed.
- Get the web application URL - WebUrl from the CloudFormation stack outputs.
- Go to the web application using a web browser.
- Register an account using a valid email address.
Complete the Event-driven Sportsbook workshop to understand how the application works.
-
Log into the AWS Management Console then empty the sportsbook WebUIBucket Amazon S3 bucket.
-
Delete the sportsbook CloudFormation stack by executing the following command from the project root directory.
sam delete --config-file samconfig.toml
Customers are responsible for making their own independent assessment of the information in this Guidance. This Guidance: (a) is for informational purposes only, (b) represents AWS current product offerings and practices, which are subject to change without notice, and (c) does not create any commitments or assurances from AWS and its affiliates, suppliers or licensors. AWS products or services are provided “as is” without warranties, representations, or conditions of any kind, whether express or implied. AWS responsibilities and liabilities to its customers are controlled by AWS agreements, and this Guidance is not part of, nor does it modify, any agreement between AWS and its customers.
