You can use the ALIYUN::VPC::VpnConnection resource type to create an IPsec-VPN connection.
Syntax
{
"Type": "ALIYUN::VPC::VpnConnection",
"Properties": {
"IpsecConfig": Map,
"Name": String,
"IkeConfig": Map,
"HealthCheckConfig": Map,
"VpnGatewayId": String,
"CustomerGatewayId": String,
"RemoteSubnet": String,
"LocalSubnet": String,
"EffectImmediately": Boolean,
"EnableTunnelsBgp": Boolean,
"RemoteCaCertificate": String,
"BgpConfig": Map,
"AutoConfigRoute": Boolean,
"EnableDpd": Boolean,
"EnableNatTraversal": Boolean,
"TunnelOptionsSpecification": List
}
}Properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Name | String | No | Yes | The name of the IPsec-VPN connection. | The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with |
IkeConfig | Map | No | Yes | The configuration of Phase 1 negotiation. | For more information, see IkeConfig properties. |
IpsecConfig | Map | No | Yes | The configuration of Phase 2 negotiation. | For more information, see IpsecConfig properties. |
HealthCheckConfig | Map | No | No | The configuration of the health check. | For more information, see HealthCheckConfig properties. |
VpnGatewayId | String | Yes | No | The ID of the VPN Gateway. | None |
CustomerGatewayId | String | No | No | The ID of the customer gateway. | None |
RemoteSubnet | String | Yes | Yes | The CIDR block of the on-premises data center. This CIDR block is used for Phase 2 negotiation. | Separate multiple CIDR blocks with commas (,). Example: 192.168.3.0/24,192.168.4.0/24. |
LocalSubnet | String | Yes | Yes | The CIDR block of the VPC that interconnects with the on-premises data center. This CIDR block is used for Phase 2 negotiation. | Separate multiple CIDR blocks with commas (,). Example: 192.168.1.0/24,192.168.2.0/24. |
EffectImmediately | Boolean | No | Yes | Specifies whether to delete the current IPsec tunnel and renegotiate. | Valid values:
|
EnableTunnelsBgp | Boolean | No | No | The enabling status of Border Gateway Protocol (BGP) for the tunnel. | Valid values:
|
RemoteCaCertificate | String | No | No | The CA certificate of the peer. | None |
BgpConfig | Map | No | Yes | The BGP configuration of the tunnel. | For more information, see BgpConfig properties. |
AutoConfigRoute | Boolean | No | Yes | Specifies whether to automatically configure routes. | Valid values:
|
EnableDpd | Boolean | No | Yes | Specifies whether to enable the Dead Peer Detection (DPD) feature for the IPsec-VPN connection. | Valid values:
|
EnableNatTraversal | Boolean | No | Yes | Specifies whether to enable the NAT traversal feature for the tunnel. | Valid values:
|
TunnelOptionsSpecification | List | No | No | The tunnel configuration of the IPsec-VPN connection. | For more information, see TunnelOptionsSpecification properties. |
IkeConfig syntax
"IkeConfig": {
"RemoteId": String,
"Psk": String,
"IkeVersion": String,
"IkeMode": String,
"IkeAuthAlg": String,
"IkeEncAlg": String,
"IkePfs": String,
"IkeLifetime": Integer,
"LocalId": String
}IkeConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
RemoteId | String | No | Yes | The identity of the customer gateway. | The value can be up to 100 characters in length. The default value is the public IP address of the customer gateway. |
Psk | String | No | Yes | Authentication between the IPsec VPN Gateway and the customer gateway. | The value can be up to 100 characters in length. By default, the system randomly generates a key. You can also specify the key. |
IkeVersion | String | No | Yes | The version of the IKE protocol. | Valid values:
|
IkeMode | String | No | Yes | The negotiation mode of IKEv1. | Valid values:
|
IkeAuthAlg | String | No | Yes | The authentication algorithm for Phase 1 negotiation. | Valid values:
|
IkeEncAlg | String | No | Yes | The encryption algorithm for Phase 1 negotiation. | Valid values:
|
IkePfs | String | No | Yes | The Diffie-Hellman key exchange algorithm used for Phase 1 negotiation. | Valid values:
|
IkeLifetime | Integer | No | Yes | The lifetime of the SA negotiated in Phase 1. | The value must be between 0 and 86,400. The default value is 86,400. |
LocalId | String | No | Yes | The identity of the VPN Gateway. | The value can be up to 100 characters in length. The default value is the IP address of the VPN Gateway. |
IpsecConfig syntax
"IpsecConfig": {
"IpsecAuthAlg": String,
"IpsecEncAlg": String,
"IpsecLifetime": Integer,
"IpsecPfs": String
}IpsecConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
IpsecAuthAlg | String | No | Yes | The authentication algorithm for Phase 2 negotiation. | Valid values:
|
IpsecEncAlg | String | No | Yes | The encryption algorithm for Phase 2 negotiation. | Valid values:
|
IpsecLifetime | Integer | No | Yes | The lifetime of the SA negotiated in Phase 2. | The value must be between 0 and 86,400. Unit: seconds. The default value is 86,400. |
IpsecPfs | String | No | Yes | The Diffie-Hellman key exchange algorithm used for Phase 2 negotiation. | Valid values:
|
HealthCheckConfig syntax
"HealthCheckConfig": {
"Enable": Boolean,
"Dip": Boolean,
"Retry": Integer,
"Sip": String,
"Interval": Integer,
"Policy": String
} HealthCheckConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Enable | Boolean | No | Yes | Specifies whether to enable health checks. | Valid values:
If you set the value to true, you must configure the other parameters. |
Interval | Integer | No | Yes | The interval between health check retries. | Unit: seconds. |
Retry | Integer | No | Yes | The number of times to send health check packets. | None |
Dip | String | No | Yes | The destination IP address. This is the IP address of the on-premises data center that you can access through the IPsec-VPN connection. | None |
Sip | String | No | Yes | The source IP address. This is the IP address that the on-premises data center can access through the IPsec-VPN connection. | None |
Policy | String | No | Yes | Specifies whether to revoke the published route when the health check fails. | None |
BgpConfig syntax
"BgpConfig": {
"TunnelCidr": String,
"LocalBgpIp": String,
"EnableBgp": Boolean,
"LocalAsn": Number
} BgpConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
TunnelCidr | String | No | Yes | The BGP CIDR block of the tunnel. | None |
LocalBgpIp | String | No | Yes | The BGP IP address on the Alibaba Cloud side of the tunnel. | None |
EnableBgp | Boolean | No | No | Specifies whether to enable the BGP feature for the tunnel. | Valid values:
The default value is false. |
LocalAsn | Number | No | Yes | The autonomous system number (ASN) on the Alibaba Cloud side of the tunnel. | None |
TunnelOptionsSpecification syntax
"TunnelOptionsSpecification": [
{
"RemoteCaCertificate": String,
"CustomerGatewayId": String,
"TunnelBgpConfig": Map,
"TunnelIpsecConfig": Map,
"EnableDpd": Boolean,
"TunnelIkeConfig": Map,
"EnableNatTraversal": Boolean,
"Role": String
}
]TunnelOptionsSpecification properties
Property Name | Type | Required | Update allowed | Description | Constraints |
RemoteCaCertificate | String | No | No | The CA certificate of the peer of the tunnel. | This parameter is returned only when the VPN Gateway instance is a ShangMi (SM) instance. |
CustomerGatewayId | String | No | Yes | The ID of the customer gateway associated with the tunnel. | None |
TunnelBgpConfig | Map | No | Yes | The BGP configuration of the tunnel. | For more information, see TunnelBgpConfig properties. |
TunnelIpsecConfig | Map | No | No | The configuration of Phase 2 negotiation. | For more information, see TunnelIpsecConfig properties. |
EnableDpd | Boolean | No | Yes | Specifies whether to enable the DPD feature for the IPsec-VPN connection. | Valid values:
|
TunnelIkeConfig | Map | No | Yes | The configuration of Phase 1 negotiation. | For more information, see TunnelIkeConfig properties. |
EnableNatTraversal | Boolean | No | Yes | Specifies whether to enable the NAT traversal feature for the IPsec-VPN connection. | Valid values:
|
Role | String | No | Yes | The role of the tunnel. | Valid values:
|
TunnelBgpConfig syntax
"TunnelBgpConfig": {
"TunnelCidr": String,
"LocalAsn": Number,
"LocalBgpIp": String
} TunnelBgpConfig properties
Property name | Type | Required | Update allowed | Description | Constraints |
TunnelCidr | String | No | Yes | The BGP CIDR block of the tunnel. | None |
LocalBgpIp | String | No | Yes | The BGP IP address on the Alibaba Cloud side of the tunnel. | None |
LocalAsn | Number | No | Yes | The ASN on the Alibaba Cloud side of the tunnel. | None |
TunnelIpsecConfig syntax
"TunnelIpsecConfig": {
"IpsecAuthAlg": String,
"IpsecEncAlg": String,
"IpsecPfs": String,
"IpsecLifetime": Integer
} TunnelIpsecConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
IpsecAuthAlg | String | No | Yes | The authentication algorithm for the IPsec phase. | None |
IpsecEncAlg | String | No | Yes | The encryption algorithm for the IPsec phase. | None |
IpsecPfs | String | No | Yes | Lifetime of an IPsec phase. | Unit: seconds. |
IpsecLifetime | Integer | No | Yes | The autonomous system number (ASN) for the Alibaba Cloud side of the tunnel. | None |
TunnelIkeConfig syntax
"TunnelIkeConfig": {
"Psk": String,
"IkePfs": String,
"LocalId": String,
"IkeVersion": String,
"IkeAuthAlg": String,
"IkeMode": String,
"RemoteId": String,
"IkeLifetime": Integer,
"IkeEncAlg": String
} TunnelIkeConfig properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Psk | String | No | Yes | The pre-shared key. | None |
IkePfs | String | No | Yes | The DH group for the IKE phase. | None |
LocalId | String | No | Yes | The identity on the Alibaba Cloud side of the tunnel. | None |
IkeVersion | String | No | Yes | The version of the IKE protocol. | Valid values:
Compared with IKEv1, IKEv2 simplifies the SA negotiation process and provides better support for multi-CIDR-block scenarios. |
IkeAuthAlg | String | No | Yes | The authentication algorithm for the IKE phase. | |
IkeMode | String | No | Yes | The IKE negotiation mode. | Valid values:
|
RemoteId | String | No | Yes | The identity of the peer of the tunnel. | None |
IkeLifetime | Integer | No | Yes | The lifetime of the IKE phase. | Unit: seconds. |
IkeEncAlg | String | No | Yes | The encryption algorithm for the IKE phase. | None |
Return values
Fn::GetAtt
VpnConnectionId: The ID of the IPsec-VPN connection.
Status: The status of the IPsec-VPN connection.
PeerVpnConnectionConfig: The connection configuration for the peer VPC.