Is it possible to add route entries to a route table via cdk?
The way I tried is: using a vpc construct I tried to iterate over the public_subnets + private_subnets attributes lists to get the routeTables. But these return IRouteTable -- with which I can't seem to do any updates. Anyone know how to do it? Thanks.
You can able to solve this by instantiating new CloudFormation Route resources:
You will need to know the ID of the peering connection for those routes. In the example above, it's referenced as it's created in the same stack:
Consider [1] , [2] and [3] for more details
[1] https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-from-wbr-vpc-wbr-attributesscope-id-attrs
[2] https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Subnet.html#add-wbr-routeid-options
[3] https://qiita.com/is_ryo/items/66dfe6c4b6dda4bd1eeb