ALIYUN::VPC::VpcPeerConnection is used to create a virtual private cloud (VPC) peering connection.

Syntax

{
  "Type": "ALIYUN::VPC::VpcPeerConnection",
  "Properties": {
    "Description": String,
    "DeletionForce": Boolean,
    "AcceptingVpcId": String,
    "VpcId": String,
    "AcceptingRegionId": String,
    "AcceptingAliUid": Integer,
    "Name": String
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
DescriptionStringNoYesThe description of the VPC peering connection. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
DeletionForceBooleanNoYesSpecifies whether to forcefully delete the VPC peering connection. Valid values:
  • true
  • false
AcceptingVpcIdStringYesNoThe ID of the acceptor VPC. The ID of the acceptor VPC must be different from the ID of the requester VPC.
VpcIdStringYesNoThe ID of the requester VPC. None.
AcceptingRegionIdStringNoNoThe region ID of the acceptor VPC. Valid values:
  • If you want to create a VPC peering connection in the same region, specify a region ID that is the same as the region ID of the requester VPC.
  • If you want to create an VPC peering connection across regions, specify a region ID that is different from the region ID of the requester VPC.
AcceptingAliUidIntegerNoNoThe ID of the Alibaba Cloud account to which the acceptor VPC belongs. Valid values:
  • If you want to create a VPC peering connection within your Alibaba Cloud account, specify the ID of your Alibaba Cloud account.
  • If you want to create a VPC peering connection between your Alibaba Cloud account and another Alibaba Cloud account, specify the ID of the peer Alibaba Cloud account.
Note If the acceptor VPC belongs to a RAM user, specify the Alibaba Cloud account to which the RAM user belongs.
NameStringNoYesThe name of the VPC peering connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). The name must start with a letter.

Return values

Fn::GetAtt

InstanceId: the ID of the VPC.

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "AcceptingVpcId": {
          "Type": "String",
          "Description": "The ID of the acceptor VPC."
        },
        "VpcId": {
          "Type": "String",
          "Description": "The ID of the requester VPC."
        }
      },
      "Resources": {
        "VpcPeerConnection": {
          "Type": "ALIYUN::VPC::VpcPeerConnection",
          "Properties": {
            "AcceptingVpcId": {
              "Ref": "AcceptingVpcId"
            },
            "VpcId": {
              "Ref": "VpcId"
            }
          }
        }
      },
      "Outputs": {
        "InstanceId": {
          "Description": "The ID of the VPC peering connection.",
          "Value": {
            "Fn::GetAtt": [
              "VpcPeerConnection",
              "InstanceId"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      AcceptingVpcId:
        Type: String
        Description: The ID of the acceptor VPC.
      VpcId:
        Type: String
        Description: The ID of the requester VPC.
    Resources:
      VpcPeerConnection:
        Type: ALIYUN::VPC::VpcPeerConnection
        Properties:
          AcceptingVpcId:
            Ref: AcceptingVpcId
          VpcId:
            Ref: VpcId
    Outputs:
      InstanceId:
        Description: The ID of the VPC peering connection.
        Value:
          Fn::GetAtt:
            - VpcPeerConnection
            - InstanceId