This is an AWS CDK script for a multi-region deployment of the TicTacToe game demo.
This scripts is made of two stacks :
- the database stack manages a DynamoDB Table, globally replicated across
us-east-1
andus-west-2
. - the application stacks manages an autoscaling group with minimum two
t4g.micro
instances and an Application Load Balancer.
The application stack is created both in us-east-1
and us-west-2
regions.
The very first time, be sure to run
cdk bootstrap
Be sure to have a CLI config with admin permission and using us-east-1
as default region
To deploy the stack across the two regions, just type :
cdk deploy --all --outputs-file out.json
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template