aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

Create a Route to a TransitGateway

Open evildani opened this issue 7 years ago • 6 comments

In a VPC's (or Subnet) RouteTable there is no current method to select the gateway as a TransitGateway. From the CLI you can do: create-route [--transit-gateway-id ]

In CDK in the CfnRouteProps there is no withTransitGatewayId to provide in the route.

If used withGatewayId(CfnTransitGateway) the following error happens upon deploy. sbnetP1Route Route did not stabilize in expected time, but Synth correctly runs.

evildani avatar Mar 20 '19 15:03 evildani

Does the feature you need exist in CloudFormation?

rix0rrr avatar Mar 21 '19 11:03 rix0rrr

mmmm its missing in CloudFormation also: In CLI you can do: ec2 create-route [--transit-gateway-id ]

Yet, on Cloudformation the route entry does not have a corresponding –transit-gateway-id, from documentation:

{ "Type" : "AWS::EC2::Route", "Properties" : { "DestinationCidrBlock" : String, "DestinationIpv6CidrBlock" : String, "EgressOnlyInternetGatewayId" : String, "GatewayId" : String, "InstanceId" : String, "NatGatewayId" : String, "NetworkInterfaceId" : String, "RouteTableId" : String, "VpcPeeringConnectionId" : String } }

The fact that is missing from CloudFormation means that it can not be included in CDK?

evildani avatar Mar 21 '19 13:03 evildani

Correct.

rix0rrr avatar Mar 21 '19 13:03 rix0rrr

Cloudformation supports it now https://docs.aws.amazon.com/en_en/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-route.html

konstantinj avatar Oct 01 '19 12:10 konstantinj

I could also need this one, maybe it should be reopened now that cloud formation also supports it ?

giovannidegani avatar Oct 17 '19 08:10 giovannidegani

@evildani @konstantinj @giovannidegani

transitGatewayId was added to CfnRouteProps automatically when it was added to Cloudformation since it's an L1. See the docs here. Let me know if this doesn't fully fulfill what you were looking for.

SomayaB avatar Oct 17 '19 22:10 SomayaB