All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::VpcPeerConnection

Last Updated:Oct 13, 2023

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

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

Description

String

No

Yes

The description of the VPC peering connection.

The description must be 2 to 256 characters in length. It must start with a letter and cannot start with http:// or https://.

DeletionForce

Boolean

No

Yes

Specifies whether to forcefully delete the VPC peering connection.

Valid values:

  • true

  • false

AcceptingVpcId

String

Yes

No

The ID of the acceptor VPC.

The ID of the acceptor VPC must be different from the ID of the requester VPC.

VpcId

String

Yes

No

The ID of the requester VPC.

None.

AcceptingRegionId

String

No

No

The region ID of the acceptor VPC.

Valid values:

  • If you want to create an intra-region VPC peering connection, specify a region ID that is the same as the region ID of the requester VPC.

  • If you want to create an inter-region VPC peering connection, specify a region ID that is different from the region ID of the requester VPC.

AcceptingAliUid

Integer

No

No

The 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 Resource Access Management (RAM) user, specify the ID of the Alibaba Cloud account to which the RAM user belongs.

Name

String

No

Yes

The name of the VPC peering connection.

The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

Return values

Fn::GetAtt

InstanceId: the ID of the instance on which the VPC peering connection is created.

Examples

  • 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
  • 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"
            ]
          }
        }
      }
    }