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

Allow VPCs to have a default gateway via VPN gateway #7918

Closed
1 of 2 tasks
MentalPower opened this issue May 11, 2020 · 1 comment
Closed
1 of 2 tasks

Allow VPCs to have a default gateway via VPN gateway #7918

MentalPower opened this issue May 11, 2020 · 1 comment
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@MentalPower
Copy link

Use Case

You can currently create a VPC with isolated subnets and a VPN Gateway via something like:

const vpc = new ec2.Vpc(this, 'Vpc' {
  vpnGatewayAsn: 1234,
  vpnGateway: true,
  subnetConfiguration: [{
    subnetType: ec2.SubnetType.ISOLATED,
    name: "",
  }],
}); 

However, there's currently no way for those isolated subnets to treat the VPN gateway as their default route. This case is common in setups where all internet-bound traffic goes through another account/VPC.

Proposed Solution

const vpc = new ec2.Vpc(this, 'Vpc' {
  vpnGatewayAsn: 1234,
  vpnGateway: true,
  subnetConfiguration: [{
    subnetType: ec2.SubnetType.ISOLATED,
    name: "",
  }],
  vpnDefaultGateway: [{
    subnetType: ec2.SubnetType.ISOLATED,
  }],
}); 

This configuration will then call the existing subnet.addDefaultInternetRoute() method (currently only used for Internet Gateways) passing in the selected subnets and the newly created VPNGW attachment.

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@MentalPower MentalPower added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 11, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label May 12, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented May 13, 2020

I'm wary of adding more bells and whistles to the existing VPC class.

Treating this as duplicate of #5927

@rix0rrr rix0rrr closed this as completed May 13, 2020
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 feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants