Walkthrough of creating AWS CloudFormation stacks to deploy and run docker containers on Amazon Elastic Container Service (ECS) with AWS Fargate. This involves creating Elastic Container Registry (ECR), multiple CloudFormation stacks for groups of resources on cloud – VPC, Subnets, Load balancers, CloudWatch, ECS Cluster, Container Tasks and Services etc.
- Containerize a simple REST API application – Build Docker Image
- Using AWS CLI, create a repository on Amazon Elastic Container Registry (Docker Registry)
- Push the docker image to the repository on Amazon ECR
- Define and run CloudFormation stack to create VPC and all network components
- Define and run CloudFormation stack to create IAM roles
- Define and run CloudFormation stack to create ECS Cluster, Load balancer, CloudWatch Log Group, and Security Groups
- Define and run CloudFormation stack to deploy docker application – Create Task for container, Service to schedule the task, Load balancer target group for container services, and Load balancer listener rule for container service