如何避免Cloudformation 定义中Transit Gateway和路由表之间的循环依赖关系?

0

【以下的问题经过翻译处理】 在 Cloudformation 模板中,我可以选择为 TransitGateway 定义“AssociationDefaultRouteTableId”和“PropagationDefaultRouteTableId”。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgateway.html

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

但是 TransitGatewayRouteTable 有必填参数 TransitGatewayId ,这会导致路由表和TGW之间的循环依赖。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetable.html

Type: AWS::EC2::TransitGatewayRouteTable
Properties: 
  ...
  TransitGatewayId: String

有没有办法以某种方式解决这个问题在 Cloudformation 模板中TGW设置 AssociationDefaultRouteTableIdPropagationDefaultRouteTableId

profile picture
EXPERT
asked 6 months ago13 views
1 Answer
0

【以下的回答经过翻译处理】 无法实现,可以通过使用一个自定义的lambda,在它被创建后修改TGW的默认设置,以达到相同的结果。这里有一个github的例子:https://github.com/alexandrespbr/vpcsharednfw/blob/3aad9e78c08610b2e3602364158f78867338db39/egressVpc.yaml#L475

profile picture
EXPERT
answered 6 months ago

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