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

Add route table IDs to VPC context provider #2487

Closed
jkenn99 opened this issue May 6, 2019 · 1 comment · Fixed by #3171
Closed

Add route table IDs to VPC context provider #2487

jkenn99 opened this issue May 6, 2019 · 1 comment · Fixed by #3171
Labels
feature-request A feature should be added or improved.

Comments

@jkenn99
Copy link
Contributor

jkenn99 commented May 6, 2019

I would like to create Route resources on an existing VPC.

My use case looks something like this:

const new_vpc = new ec2.VpcNetwork(this, 'new_vpc' {
  // ...
});
const vpcId =  'vpc-xxx';
const existing_vpc = ec2.VpcNetwork.importFromContext(this, 'existing_vpc', {
  vpcId: vpcId,
});
const pcx = new ec2.CfnVPCPeeringConnection(this, 'new_vpc-existing_vpc', {
  vpcId: vpcId,
  peerVpcId: new_vpc.vpcId,
});
import_vpc.publicSubnets.forEach((subnet,index) => {
  new ec2.CfnRoute(this, 'route-' + index, {
    routeTableId: subnet.routeTableId,
    destinationCidrBlock: new_vpc.cidr,
    vpcPeeringConnectionId: pcx.ref,
  });
});
@jkenn99 jkenn99 added the feature-request A feature should be added or improved. label May 6, 2019
@mhuebner
Copy link

mhuebner commented Jun 26, 2019

Related to #2926 but your code does not match to the structure of current CDK-Version (0.36.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants