Fetching the route table id attached to a specific VPC #17831
-
Hello Folks, For my CDK app, I am able to find the required VPC id using the ec2.Vpc.from_lookup method. Further, I need to find the route table id that is applied to this VPC. Finally I need to enable route propagation to this route table to complete my site2site VPN setup. When I provide the route table id manually to the ec2.CfnVPNGatewayRoutePropagation construct, I can finish what I want to achive. The way I want is : I need to fetch the rpute table id attached to my VPC and then pass it automatically to the ec2.CfnVPNGatewayRoutePropagation construct. I tried to read the documentation and it seem it is not possible to fetch the route table id from a VPC. Can you help me with this requirement? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
All information retrieved from lookup can be found in |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
All information retrieved from lookup can be found in
cdk.context.json
, including the route table ID in this case. You can access this context withtryGetContext
https://docs.aws.amazon.com/cdk/v2/guide/context.html