This is a simple application to demonstrate the usage of AWS CDK. We will deploy a docker container (from docker hub, you can also use AWS ECR to deploy a conatainerized application in AWS Fargate.
-
This demo, instructions, scripts and cloudformation template is designed to be run in
us-east-1
. With few modifications you can try it out in other regions as well(Not covered here).- AWS CLI pre-configured
-
-
Get the application code
git clone https://github.com/miztiik/cdk-demo-app.git cd cdk-demo-app
-
-
If you have AWS CDK installed you can close this repository and deploy the stack with,
# If you DONT have cdk installed npm install -g aws-cdk # Make sure you in root directory cd cdk-demo-app source .env/bin/activate pip install -r requirements.txt
The very first time you deploy an AWS CDK app into an environment (account/region), you’ll need to install a
bootstrap stack
, Otherwise just go aheadand deploy usingcdk deploy
cdk bootstrap cdk deploy
-
The
cdk deploy
command should provide you the application load balancer url to access the web app. You can get the same from cloudformation outputs or in the ALB page. -
If you want to destroy all the resources created by the stack, Execute the below command to delete the stack, or you can delete the stack from console as well
cdk destroy
This is not an exhaustive list, please carry out other necessary steps as maybe applicable to your needs.
Level: 300