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(ec2): functions addIngressRule and addEgressRule detect unresolved tokens as duplicates #17221

Merged
merged 6 commits into from Nov 2, 2021

Conversation

peterwoodworth
Copy link
Contributor

@peterwoodworth peterwoodworth commented Oct 28, 2021

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

@gitpod-io
Copy link

gitpod-io bot commented Oct 28, 2021

@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Oct 28, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2021

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 28, 2021
@peterwoodworth peterwoodworth changed the title fix(ec2) addIngressRule and addEgressRule detect unresolved tokens as… fix(ec2): addIngressRule and addEgressRule detect unresolved tokens as… Oct 28, 2021
@peterwoodworth peterwoodworth changed the title fix(ec2): addIngressRule and addEgressRule detect unresolved tokens as… fix(ec2): functions addIngressRule and addEgressRule detect unresolved tokens as duplicates Oct 28, 2021
} else {
return peer.uniqueId;
}
}
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

This giant comment block here is really useful. Would be a shame to lose it and/or its context. Can you reunite it back with its friend, the determineRuleScope method? 🥺

}

private renderPeer(peer: IPeer) {
if (Token.isUnresolved(peer.uniqueId)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A quick comment here explaining the why of this would be useful for future maintainers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added right below line 193

@mergify
Copy link
Contributor

mergify bot commented Nov 2, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 35ef187
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit d4952c3 into master Nov 2, 2021
@mergify mergify bot deleted the peterwoodworth/sgRuleFix branch November 2, 2021 17:35
@mergify
Copy link
Contributor

mergify bot commented Nov 2, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…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*
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 contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(ec2): addIngressRule and addEgressRule detect unresolved tokens as duplicates
3 participants