Skip to content

pjlewisuk/ecs-service-discovery-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECS Service Discovery

This demo deploys Randall Hunt's ECS Service Discovery example using CloudFormation. The example provides two docker containers: backend and worker. Both run simple flask apps. The ".corp" domain name is assumed for discovery purposes. Full details can be found in his blog post.

Click here for setup steps to run prior to launching the CloudFormation stack. Please ensure you push the container images to ECR repositories in the same AWS account as you deploy the CloudFormation stacks below, otherwise the ECS services will fail to launch.

You can launch this CloudFormation stack in your account:

AWS Region Short name Launch
US East (Ohio) us-east-2 cloudformation-launch-button
US East (N. Virginia) us-east-1 cloudformation-launch-button
US West (Oregon) us-west-2 cloudformation-launch-button
EU (Ireland) eu-west-1 cloudformation-launch-button
EU (Frankfurt) eu-central-1 cloudformation-launch-button
Asia Pacific (Singapore) ap-southeast-1 cloudformation-launch-button
Asia Pacific (Tokyo) ap-northeast-1 cloudformation-launch-button
Asia Pacific (Sydney) ap-southeast-2 cloudformation-launch-button

Launching one of the stacks above will provide a simplified version of the following architecture, with only two services: backend to serve requests, with a single worker microservice to provide responses. You can find the web endpoint where the service is hosted on the 'Output' tab of the main CloudFormation stack that was created, or by running the following command:
aws cloudformation describe-stacks --stack-name ecs-sd-demo --query 'Stacks[0].Outputs[?OutputKey==`DemoServiceUrl`].OutputValue' --output text

Architecture

To update the CloudFormation deployment to add more services, simply select "Update Stack" from the Actions menu with the master stack selected, continue using the current template, then change the DeployAdditionalServices parameter to True and click through to finish the wizard. To do this via the CLI run the following command:
aws cloudformation update-stack --stack-name ecs-sd-demo --template-url https://s3-eu-west-1.amazonaws.com/pjlewis-aws-ecs-service-discovery-demo/master.yaml --parameters ParameterKey=DeployAdditionalServices,ParameterValue=true

After a few minutes the additional services will be deployed and when you refresh the page you will see them listed under the services found via service discovery.

About

A quick demo to show off Amazon ECS Service Discovery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 63.3%
  • Python 28.7%
  • Dockerfile 8.0%