-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(ec2): addIngressRule and addEgressRule detect unresolved tokens as duplicates #17201
Comments
The first solution that comes to mind would be to maintain a lookup of the |
…d tokens as duplicates (#17221) fixes #17201 The issue is when the same security group uses these functions, so I added a private counter to `SecurityGroupBase`. However, to modify this private counter, `determineRuleScope` and `renderPeer` need to be member functions. These originally weren't member functions for a reason, and that's because `SecurityGroup` also uses these functions. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…d tokens as duplicates (aws#17221) fixes aws#17201 The issue is when the same security group uses these functions, so I added a private counter to `SecurityGroupBase`. However, to modify this private counter, `determineRuleScope` and `renderPeer` need to be member functions. These originally weren't member functions for a reason, and that's because `SecurityGroup` also uses these functions. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
When passing in a token to the
peer
property of these functions, therenderPeer()
function is called and will return a constant value'{IndirectPeer}'
.aws-cdk/packages/@aws-cdk/aws-ec2/lib/security-group.ts
Lines 174 to 193 in 5831456
If the other properties remain constant, calling this multiple times will cause only one rule to be added to the security group due to the duplicate checker seen here
aws-cdk/packages/@aws-cdk/aws-ec2/lib/security-group.ts
Lines 86 to 96 in 5831456
Reproduction Steps
Call
addIngressRule()
oraddEgressRule()
multiple times on a security group, while only changing thepeer
prop from one token to another token. Only one rule will be addedWhat did you expect to happen?
I was trying to add multiple ingress rules to a security group
What actually happened?
I only added one ingress rule to a security group
CDK CLI Version
latest
Framework Version
No response
Node.js Version
16
OS
mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: