Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python ECS Example does not register EC2 instances with the ECS Cluster #562

Open
ajbeach2 opened this issue Nov 7, 2021 · 1 comment
Open
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort ngde/pod Great issues for pods p1

Comments

@ajbeach2
Copy link

ajbeach2 commented Nov 7, 2021

What is the problem?

https://github.com/aws-samples/aws-cdk-examples/blob/master/python/ecs/ecs-service-with-advanced-alb-config/app.py

The Python ECS example does not work as expected. The ECS cluster is created and the auto scaling groups are created, but no ec2 instances are registered.

Additionally, the STANDARD5 (m5.micro) are not available in us-east-1.

Reproduction Steps

Run the python example in us-east-1
https://github.com/aws-samples/aws-cdk-examples/blob/master/python/ecs/ecs-service-with-advanced-alb-config/app.py

  1. Observe that m5.micro are not available in us-east-1
  2. Change STANDARD5 to BUSTRABLE (or t2.micro)
  3. cdk deploy
  4. Observer that AWS::ECS::Service CREATE_IN_PROGRESS in cloudformation and this never changes.
  5. Observe the no ec2 instances are registered to the ECS cluster in the aws console

What did you expect to happen?

I expected an ECS cluster with ec2 instances assigned and the example to work as written.

What actually happened?

ECS cluster gets created, ec2 instances get created, but these instances are not registered to the ECS Cluster.

CDK CLI Version

1.130.0 (build 9c094ae)

Framework Version

No response

Node.js Version

v16.13.0

OS

Ubuntu

Language

Python

Language Version

3.8.2

Other information

No response

@ajbeach2 ajbeach2 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2021
@ryparker ryparker added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 9, 2021
@ajbeach2
Copy link
Author

I was able to resolve the issue.

I am using an existing vpc with a modified version of this example. The issue was that the autoscaling group was launching in private instances. By using public subnets, and and associating a public ip, the ecs agent was able to register to the cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort ngde/pod Great issues for pods p1
Projects
None yet
Development

No branches or pull requests

3 participants