如何避免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
demandé il y a 6 mois13 vues
1 réponse
0

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

profile picture
EXPERT
répondu il y a 6 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions