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

AutoScalingGroup does not have default_child set #3478

Closed
1 of 5 tasks
lkoniecz opened this issue Jul 30, 2019 · 2 comments · Fixed by #3572
Closed
1 of 5 tasks

AutoScalingGroup does not have default_child set #3478

lkoniecz opened this issue Jul 30, 2019 · 2 comments · Fixed by #3572
Assignees
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. language/python Related to Python bindings needs-reproduction This issue needs reproduction.

Comments

@lkoniecz
Copy link

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 ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

asg = aws_autoscaling.AutoScalingGroup(
    scope=self,
    id='asg',
    instance_type=aws_ec2.InstanceType(instance_type),
    key_name='key'
    vpc=vpc,
    machine_image=aws_eks.EksOptimizedAmi(),
    desired_capacity=5
)

 asg.node.default_child.override_logical_id('MyNewId')
Traceback (most recent call last):
...
    asg.node.default_child.override_logical_id('MyNewId')
AttributeError: 'NoneType' object has no attribute 'override_logical_id'

  • What is the expected behavior (or behavior of feature suggested)?
    It is possible to override logical id of the autoscaling group

  • What is the motivation / use case for changing the behavior or adding this feature?
    Make Improve experience for renaming L1s #207 fully working for every construct.

  • Please tell us about your environment:

    • CDK CLI Version: 1.0.0
    • Module Version: 1.0.0
    • OS: [all]
    • Language: [Python ]
  • 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)

@lkoniecz lkoniecz added the needs-triage This issue or PR still needs to be triaged. label Jul 30, 2019
@lkoniecz
Copy link
Author

Subnet construct (https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_ec2/Subnet.html) has the same problem, where it's corresponding Cfn resource is not available thru default_child - its named 'Subnet' instead of 'Resource'

@NGL321 NGL321 added bug This issue is a bug. needs-reproduction This issue needs reproduction. language/python Related to Python bindings @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud and removed needs-triage This issue or PR still needs to be triaged. labels Aug 1, 2019
rix0rrr added a commit that referenced this issue Aug 7, 2019
`AutoScalingGroup` and `Subnet` had default children with incorrect
names, so that `defaultChild` would not pick them up. Add and use an
override mechanism so that people can use the escape hatch more
conveniently with those constructs.

Fixes #3478.
@mergify mergify bot closed this as completed in #3572 Aug 8, 2019
mergify bot pushed a commit that referenced this issue Aug 8, 2019
* fix(asg/ec2): fix value of `defaultChild`

`AutoScalingGroup` and `Subnet` had default children with incorrect
names, so that `defaultChild` would not pick them up. Add and use an
override mechanism so that people can use the escape hatch more
conveniently with those constructs.

Fixes #3478.

* Update comment, add unit test
@drakir
Copy link

drakir commented Sep 9, 2019

@rix0rrr I cannot see this working for an imported subnet (originated from Vpc.fromLookup). Checking the ImportedSubnet class it seems this class doesn't have the defaultChild property set.

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

Successfully merging a pull request may close this issue.

4 participants