Skip to content

Demonstrates how to run a dockerized Python application in an ECS cluster Fargate or EC2-based)

License

Notifications You must be signed in to change notification settings

stefanfreitag/aws_cdk_ecs_ec2_cluster

Repository files navigation

Simple ECS Demo Application

Application

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.

ECS setup using Cloud Development Kit (CDK)

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.

Troubleshooting

  • 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 to true.

Links

About

Demonstrates how to run a dockerized Python application in an ECS cluster Fargate or EC2-based)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published