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

fix: Update GuAutoScalingGroup with revised logicalId logic #441

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

akash1810
Copy link
Member

What does this change?

In #364 we placed the logic of overriding a construct's logicalId into a single place.

In this change, we're updating the GuAutoScalingGroup construct to adopt the new logic. As of #418 it's as simple as using the GuStatefulMigratableConstruct mixin!

This is another PR in this series. Favouring small PRs over the a massive one (#400).

Does this change require changes to existing projects or CDK CLI?

Possibly.

The overriding logic in GuAutoScalingGroup changed. If stacks are making use of the current (broken?) logic, they will need to be attended to.

How to test

See tests?

How can we measure success?

A simpler, DRYer, more consistent code base?

Have we considered potential risks?

As noted above, the path to update to the next version of the library might require a bit of attention.

In #364 we placed the logic of overriding a construct's logicalId into a single place.

In this change, we're updating the `GuAutoScalingGroup` construct to adopt the new logic. As of #418 it's as simple as using the `GuStatefulMigratableConstruct` mixin!
@akash1810 akash1810 requested a review from a team April 13, 2021 18:11
@@ -107,7 +109,7 @@ export class GuAutoScalingGroup extends AutoScalingGroup {
userData,
// Do not use the default AWS security group which allows egress on any port.
// Favour HTTPS only egress rules by default.
securityGroup: GuHttpsEgressSecurityGroup.forVpc(scope, props),
securityGroup: GuHttpsEgressSecurityGroup.forVpc(scope, { app: props.app, vpc: props.vpc }),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented on in #400:

Passing in props meant existingLogicalId was copied to the GuHttpsEgressSecurityGroup too. When it came time to synth the stack, it failed because two resources were being created with the same logicalId (the GuHttpsEgressSecurityGroup and the GuAutoScalingGroup).

This took the best part of two days to diagnose 😨 !

@akash1810 akash1810 merged commit 1c648dc into main Apr 14, 2021
@akash1810 akash1810 deleted the aa-GuAutoScalingGroup-logicalId branch April 14, 2021 08:27
@github-actions
Copy link
Contributor

🎉 This PR is included in version 8.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants