The application consists of a Python web server rendering basic information and offering this at the root path of the server.
The container image used is available at Docker Hub.
The ECS cluster will run in a new VPC with CIDR 10.1.0.0/16. To keep the management overhead low it will be powered by Fargate.
A service and a task definition are created:
- The task definition contains the information about the container (e.g. port mappings)
- The service defines e.g. the desired count of running tasks.
After the cluster has been deployed via
cdk deploy
the DNS name of the load balancer is returned/ printed to the console.
- Can not pull image
I stumbled upon this during tests with Fargate and EC2 based Elastic Container service. For Fargate I updated the
task definition by setting
assignPublicIp
totrue
.