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

feat(global-accelerator): referencing Global Accelerator security group #9358

Merged
merged 10 commits into from
Aug 11, 2020

Conversation

flemjame-at-amazon
Copy link
Contributor


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

Copy link
Contributor

@rix0rrr rix0rrr left a 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', {
Copy link
Contributor

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 {
Copy link
Contributor

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).

@mergify mergify bot dismissed rix0rrr’s stale review August 10, 2020 15:37

Pull request has been modified.

@rix0rrr rix0rrr changed the title feat(global-accelerator): Allow referencing Global Accelerator security group feat(global-accelerator): referencing Global Accelerator security group Aug 10, 2020
rix0rrr
rix0rrr previously approved these changes Aug 10, 2020
@mergify mergify bot dismissed rix0rrr’s stale review August 10, 2020 16:03

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Aug 11, 2020

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: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: d40fff4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Aug 11, 2020

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).

@mergify mergify bot merged commit 1fe9684 into aws:master Aug 11, 2020
@flemjame-at-amazon flemjame-at-amazon deleted the global-accelerator-sg branch September 2, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants