如何避免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
ESPERTO
posta 6 mesi fa13 visualizzazioni
1 Risposta
0

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

profile picture
ESPERTO
con risposta 6 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande