By using AWS re:Post, you agree to the Terms of Use
/How to avoid circular dependency between transit gateway and route table?/

How to avoid circular dependency between transit gateway and route table?


In Cloudformation template I have an option to define AssociationDefaultRouteTableId and PropagationDefaultRouteTableId for TransitGateway.

Type: AWS::EC2::TransitGateway
  AssociationDefaultRouteTableId: String
  PropagationDefaultRouteTableId: String

But TransitGatewayRouteTable has mandatory parameter TransitGatewayId and this causes a circular dependency between route table and transit gateway :-(

Type: AWS::EC2::TransitGatewayRouteTable
  TransitGatewayId: String

Is there a way to get around this somehow and actually set AssociationDefaultRouteTableId and PropagationDefaultRouteTableId for transit gateway from Cloudformation template ?

1 Answers
Accepted Answer

I don't think you'll be able to do this how you are trying as the circular dependency will always be there.

One way that you may be able to achieve the same outcome is by using a custom lambda resource to modify the TGW defaults after it's created. Here is an example from github:

answered 2 months ago
  • Thanks! This is my thinking as well. The only thing it doesn't explain why such parameters were made available for TransitGateway resource type you can not possibly use. Looks like a bug and missing feature (that ability to set route table id's).

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions