Simplify adoption of default security group #212
jacobwinch
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to reduce boilerplate and enforce best practice, this library will create security groups with sensible defaults automatically whenever an ASG is instantiated. For new projects, this reduces complexity significantly. However, it poses some problems when migrating existing projects, which already have a security group defined. Although it is possible for existing stacks to override the library’s default behaviour and permanently inherit their existing custom security group, this is undesirable, as it prevents these stacks from using our standard patterns or picking up future improvements easily.
Unfortunately, it is not possible to replace a stack’s security group in a single CloudFormation update without introducing downtime. Attempting to add a new security group and delete an old security group in a single operation fails because the old security group still contains running instances. In order to replace a security group with the default provided by this library the following steps must be performed in sequence:
cdk
template definition:securityGroup
propGuAutoScalingGroup
may not be sufficient for all use-cases)overrideId: true
is set.cdk
(for some projects, this will happen automatically as part of CI)cdk
template to remove the old (and now unused) security group and the associated rule additionscdk
(for some projects, this will happen automatically as part of CI)The
cdk
changes outlined above are time consuming and error-prone. If steps are omitted, or performed in the wrong order, downtime may be incurred. Consequently, we would like to simplify the process of replacing existing security groups via the library. Unfortunately this migration will still need to happen via two separate CFN updates / PRs, but each code change could be made much more straightforward.Beta Was this translation helpful? Give feedback.
All reactions