-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(global-accelerator): referencing Global Accelerator security group #9358
feat(global-accelerator): referencing Global Accelerator security group #9358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny change and then it can go in
const ec2ResponseSGIdField = 'SecurityGroups.0.GroupId'; | ||
|
||
// The AWS Custom Resource that make a call to EC2 to get the security group ID, for the given VPC | ||
const lookupAcceleratorSGCustomResource = new AwsCustomResource(scope, id + 'CustomResource', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clever!
/** | ||
* The security group used by a Global Accelerator to send traffic to resources in a VPC. | ||
*/ | ||
export class AcceleratorSecurityGroup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For safety's sake, can you give this class a private constructor() { }
?
To make sure it's only used statically, gives us the opportunity to add a constructor later on should we ever need to (otherwise we can't ever make this class a construct anymore without breaking backwards compat).
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
When using certain features of a Global Accelerator (AGA) AGA creates ENIs and a security group per VPC. Referencing this SG is needed to create security group rules in other SGs, but CloudFormation and CDK don't allow you to reference this SG. This change adds an AWS custom resource which automatically discovers the security group name so you can reference it in other constructs.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license