简体   繁体   中英

VPC Peering via aws-cdk

I created 2 VPCs using aws-cdk. cdk is creating route tables dynamically when cloudformation stack is created. I created a peering connection between the two VPCs I created using CfnVPCPeeringConnection but I am not sure how to add route to vpc peering connection as I do not know what would be the RouteTableId.

You probably mean the peering connection id. Once you know it you can modify the routing tables.

In typescript, you get it this way

import ec2 = require("@aws-cdk/aws-ec2");
....
const vpc_peering = new ec2.CfnVPCPeeringConnection (...)
const vpc_peering_id = vpc_peering.ref

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM