简体   繁体   中英

How to create a transi gateway attachement in a VPC to a transit gateway created in another account (with Cloudformation)

I've created a TransitGateway in an account of my organisation and I've sharing it using a resources manager with the other accounts, I am trying now to use the ID of this transit gateway to create an attachement using Cloudformation in another account using the "id" of the transit gateway but this is not working.

I've tried to get the id of the TGW in the account where it is created and pass it in the Cloudformation in the account where I want to create the attachement:

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

You are missing VpcId . It should be:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM