如何避免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 个月前10 查看次数
1 回答
0

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

profile picture
专家
已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则