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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoScalingGroup vpc_subnets doesn't seem to do anything #3859

Closed
jordan-dimov opened this issue Aug 29, 2019 · 1 comment 路 Fixed by #4089
Closed

AutoScalingGroup vpc_subnets doesn't seem to do anything #3859

jordan-dimov opened this issue Aug 29, 2019 · 1 comment 路 Fixed by #4089
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. language/python Related to Python bindings

Comments

@jordan-dimov
Copy link

jordan-dimov commented Aug 29, 2019

馃悰 Bug Report

What is the problem?

I'm using cdk with Python and have an AutoScalingGroup launching an EC2 instance within a vpc. Everything was working fine, except when I tried to add vpc_subnets to the constructor in order to specify which subnet I want the instance to launch in, cdk synth resulted in no differences to the CloudFormation templates and cdk diff doesn't reflect that either.

Reproduction Steps

If you have code like the following, the vpc_subnets parameter doesn't seem to be honoured:

aws_autoscaling.AutoScalingGroup(
    self, "MyAutoscalingGroup", 
    vpc=my_vpc,
    instance_type=aws_ec2.InstanceType.of(aws_ec2.InstanceClass.STANDARD5, aws_ec2.InstanceSize.XLARGE),
    machine_image=aws_ec2.WindowsImage(
        version=aws_ec2.WindowsVersion.WINDOWS_SERVER_2019
    ),
    vpc_subnets=aws_ec2.SubnetSelection(subnet_name="subnet-0af00000000000000"),  # (using valid subnet ID here)
)

Environment

  • CDK CLI Version: 1.6.0
  • Module Version: aws-cdk.aws-autoscaling==1.6.0
  • OS: Ubuntu
  • Language: Python
@jordan-dimov jordan-dimov added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 29, 2019
@SomayaB SomayaB added language/python Related to Python bindings @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud service/vpc labels Sep 3, 2019
@rix0rrr rix0rrr removed the needs-triage This issue or PR still needs to be triaged. label Sep 4, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 16, 2019

This seems to be a duplicate of #3548 (select individual subnets).

It's also a misuse of the API, which will be made more clear in an upcoming PR.

rix0rrr added a commit that referenced this issue Sep 16, 2019
Selecting subnets by VPC and type is a confusing topic with some
API misapprehensions.

Try to fix that by renaming `subnetName` to `subnetGroupName`, and
giving more clear error messages about legal values in case of misuse.

Closes #3859.
rix0rrr added a commit that referenced this issue Sep 16, 2019
Selecting subnets by VPC and type is a confusing topic with some
API misapprehensions.

Try to fix that by renaming `subnetName` to `subnetGroupName`, and
giving more clear error messages about legal values in case of misuse.

Closes #3859.
eladb pushed a commit that referenced this issue Sep 23, 2019
Selecting subnets by VPC and type is a confusing topic with some
API misapprehensions.

Try to fix that by renaming `subnetName` to `subnetGroupName`, and
giving more clear error messages about legal values in case of misuse.

Closes #3859.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. language/python Related to Python bindings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants