如何避免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
專家
已提問 6 個月前檢視次數 13 次
1 個回答
0

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

profile picture
專家
已回答 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南