aws-cloudformation - 如何在 VPC 中创建到在另一个账户中创建的中转网关的中转网关连接(使用 Cloudformation)

标签 aws-cloudformation

我已在我的组织的帐户中创建了一个 TransitGateway,并使用资源管理器与其他帐户共享它,我现在尝试使用此中转网关的 ID 在另一个帐户中使用 Cloudformation 创建附件使用中转网关的“id”的帐户,但这不起作用。

我尝试在创建 TGW 的帐户中获取 TGW 的 id,并将其传递到我要创建附件的帐户的 Cloudformation 中:

TransitGatewayAttachment":
{
    "Type" : "AWS::EC2::TransitGatewayAttachment",
    "Properties" : {
        "SubnetIds": [
            {
                "Ref": "PrivateSubnet1A"
            }
        ],
        "TransitGatewayId" :"tgw-xxxexxxxxxxx",
        "Ref": "VPC"
      }
}

最佳答案

您缺少VpcId 。应该是:

TransitGatewayAttachment":
{
    "Type" : "AWS::EC2::TransitGatewayAttachment",
    "Properties" : {
        "SubnetIds": [
            {
                "Ref": "PrivateSubnet1A"
            }
        ],
        "TransitGatewayId" :"tgw-xxxexxxxxxxx",
        "VpcId": {"Ref": "VPC"}
      }
}

关于aws-cloudformation - 如何在 VPC 中创建到在另一个账户中创建的中转网关的中转网关连接(使用 Cloudformation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61834062/

相关文章:

amazon-web-services - 如何在 CloudFormation yaml 模板中从 CloudWatch 设置 CloudFront 警报?

amazon-web-services - CloudFront 无法使用 S3 网站源,只能使用 REST 源 Cloudformation

amazon-web-services - 在CFT中,当TriggerType为Scheduled时,Appflow中的ScheduleStartTime的格式是什么

aws-cloudformation - REST API openapi 规范 AWS API Gateway 与 serverless.com 框架集成

amazon-web-services - 无法使用 UserData bash 脚本标记 EBS 卷

regex - cloudformation IAM 策略名称的正则表达式是什么

aws-cloudformation - 如何将 IAM Auth 仅应用于 API 网关路径的一种方法 - SAM 模板

amazon-web-services - AWS CloudFormation 自定义权限边界

amazon-web-services - AWS 云形成 : Cognito LambdaTrigger CustomEmailSender - Property "Not currently supported by AWS CloudFormation." and CDK usage

aws-cloudformation - 如何为多个现有资源编写CloudFormation模板文件以进行一键部署