Aws-cdk: ECS, AutoScaling: public clusters not being registered

Created on 13 Aug 2019  路  6Comments  路  Source: aws/aws-cdk

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • [x] :beetle: bug report
    • [ ] :rocket: feature request
    • [ ] :books: construct library gap
    • [ ] :phone: security issue or vulnerability => Please see policy
    • [ ] :question: support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce
    I would like to deploy the following public ECS cluster, with an IP address associated with the instances:

const vpc = new Vpc(this, "vpc", {
  cidr: "10.0.0.0/16",
  natGateways: 0,
  subnetConfiguration: [
    { cidrMask: 24, name: "ingress", subnetType: SubnetType.PUBLIC }
  ]
});

const cluster = new Cluster(this, "cluster", { vpc });

const scalingGroup = cluster.addCapacity("scalingGroup", {
  desiredCapacity: 1,
  instanceType,
  spotPrice,
  associatePublicIpAddress: true,
  machineImage: EcsOptimizedImage.amazonLinux2(),
  vpcSubnets: {
    onePerAz: true,
    subnetType: SubnetType.PUBLIC
  },
});

The stack is deployed and I have an instance started in my ASG. However, no container instances are associated to my ECS cluster. The problem disappears when I switch a classic public/private VPC with a NAT Gateway.

I haven't pinpointed where the issue is, whether the CloudFormation that is being generated in invalid, or if what I want is unavailable.

  • What is the expected behavior (or behavior of feature suggested)?
    Fix that behavior if it is supported by AWS, otherwise prevent setting associatePublicIpAddress in ECS clusters.

  • What is the motivation / use case for changing the behavior or adding this feature?
    Fix this use case, or clarify it's impossibility

  • Please tell us about your environment:

    • CDK CLI Version: 1.3.0
    • Module Version: 1.3.0
    • OS: all
    • Language: all
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

@aws-cdaws-ecs bug in-progress

Most helpful comment

@SomayaB Thanks for the reminder, I'll check it out

All 6 comments

This issue looks to be fixed in 1.4.

Thanks @joezhou888, it was indeed fixed in the latest version. I went through the change log again and can't tell what fixed it.

@NGL321 Do you want me to make a PR to add this as an integration test, to prevent a regression?

@joezhou888 thanks for the response! @nmussy, sorry for the delay, do you happen to know what the cloud formation difference is? If you could add a unit test and create a PR, that would be awesome!

No problem, and no I haven't investigated it yet. I'll look into it over the weekend. I'll close this issue with the test PR

@nmussy Did you ever get a chance to get back to this?

@SomayaB Thanks for the reminder, I'll check it out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PaulMaddox picture PaulMaddox  路  3Comments

ababra picture ababra  路  3Comments

v-do picture v-do  路  3Comments

artyom-melnikov picture artyom-melnikov  路  3Comments

eladb picture eladb  路  3Comments