Crea una conexión de emparejamiento de VPC.
Descripción de la operación
Antes de crear una conexión de emparejamiento de VPC, tenga en cuenta los siguientes puntos:
-
CreateVpcPeerConnection es una operación asíncrona. El sistema devuelve un ID de instancia, pero la conexión IPsec aún no se ha creado y la tarea se ejecuta en segundo plano. Llame a GetVpcPeerConnectionAttribute para consultar el estado de la tarea.
-
Si la conexión de emparejamiento de VPC está en estado Creating, significa que se está creando.
-
Si la conexión de emparejamiento de VPC está en estado Activated, significa que ya se creó.
-
Si la conexión de emparejamiento de VPC está en estado Accepting, se trata de una conexión entre cuentas. La conexión debe aceptarse desde el lado del receptor.
-
-
No puede llamar repetidamente a CreateVpcPeerConnection dentro del período de tiempo especificado.
Cuando crea una conexión de emparejamiento de VPC, el sistema activa automáticamente Cloud Data Transfer (CDT) por usted.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
vpc:CreateVpcPeerConnection |
create |
*All Resource
|
Ninguna | Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| RegionId |
string |
Sí |
El ID de la región donde desea crear la conexión de emparejamiento de VPC. Llame a la operación DescribeRegions para consultar la lista de regiones más reciente. |
cn-hangzhou |
| VpcId |
string |
Sí |
El ID de la VPC solicitante. |
vpc-bp1gsk7h12ew7oegk**** |
| AcceptingAliUid |
integer |
Sí |
El ID de la cuenta de Alibaba Cloud a la que pertenece la VPC receptora.
Nota
Si el receptor es un usuario RAM, establezca AcceptingAliUid con el ID de la cuenta de Alibaba Cloud que creó dicho usuario RAM. |
1210123456123456 |
| AcceptingRegionId |
string |
Sí |
El ID de región de la VPC receptora de la conexión de emparejamiento de VPC que desea crear.
|
cn-hangzhou |
| AcceptingVpcId |
string |
Sí |
El ID de la VPC receptora. |
vpc-bp1vzjkp2q1xgnind**** |
| Name |
string |
No |
El nombre de la conexión de emparejamiento de VPC. El nombre debe tener entre 2 y 128 caracteres de longitud, y puede contener dígitos, guiones bajos (_) y guiones (-). Debe comenzar con una letra. |
vpcpeer |
| Description |
string |
No |
La descripción de la conexión de emparejamiento de VPC. La descripción debe tener entre 2 y 256 caracteres de longitud. Debe comenzar con una letra, pero no puede empezar con |
description |
| DryRun |
boolean |
No |
Especifica si se debe realizar solo una ejecución de prueba (dry run), sin ejecutar la solicitud real. Valores válidos:
|
false |
| ClientToken |
string |
No |
El token de cliente que se utiliza para garantizar la idempotencia de la solicitud. Puede utilizar el cliente para generar el token, pero debe asegurarse de que sea único entre diferentes solicitudes. El token solo puede contener caracteres ASCII y no debe exceder los 64 caracteres de longitud. Nota
Si no especifica este parámetro, el sistema utiliza automáticamente el ID de solicitud como token de cliente. El ID de solicitud puede ser diferente para cada solicitud. |
02fb3da4-130e-11e9-8e44-001**** |
| ResourceGroupId |
string |
No |
El ID del grupo de recursos. Para obtener más información sobre los grupos de recursos, consulte Grupos de recursos. |
rg-acfmxazb4ph6aiy**** |
| Bandwidth |
integer |
No |
El ancho de banda de la conexión de emparejamiento de VPC. Unidad: Mbit/s. El valor debe ser un número entero mayor que 0. Antes de especificar este parámetro, asegúrese de haber creado una conexión de emparejamiento de VPC interregional. |
100 |
| LinkType |
string |
No |
El tipo de enlace de la conexión de emparejamiento de VPC que desea crear. Valores válidos:
Nota
|
Gold |
| Tag |
array<object> |
No |
Las etiquetas. |
|
|
object |
No |
Las etiquetas. |
||
| Key |
string |
No |
La clave de la etiqueta. Debe especificar al menos una clave de etiqueta y como máximo 20. La clave de la etiqueta no puede ser una cadena vacía. La clave de la etiqueta puede tener hasta 128 caracteres de longitud. No puede comenzar con |
FinanceDept |
| Value |
string |
No |
El valor de la etiqueta. Debe especificar al menos un valor de etiqueta y puede especificar hasta 20. El valor de la etiqueta puede ser una cadena vacía. El valor de la etiqueta puede tener hasta 128 caracteres de longitud. No puede comenzar con |
FinanceJoshua |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
El ID de la solicitud. |
||
| RequestId |
string |
El ID de la solicitud. |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
| InstanceId |
string |
El ID de la instancia en la que se crea la conexión de emparejamiento de VPC. |
pcc-lnk0m24khwvtkm**** |
Ejemplos
Respuesta exitosa
JSON Formato
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
"InstanceId": "pcc-lnk0m24khwvtkm****"
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | OperationFailed.CdtNotOpened | The operation failed because the Cdt service is not opened. | The operation failed because CDT is not activated. |
| 400 | OperationFailed.CrossBorderCdtNotOpened | The operation failed because the CrossBorderCdt service is not opened. | |
| 400 | IncorrectStatus.Vpc | The status of %s [%s] is incorrect. | The status of the initiator VPC instance is incorrect. |
| 400 | IncorrectStatus.AcceptingVpc | The status of %s [%s] is incorrect. | The receiving VPC status is incorrect. |
| 400 | ResourceAlreadyExist.RouterInterface | The specified resource of %s already exists. | The specified router interface already exists. |
| 400 | ResourceAlreadyExist.VpcPeer | The specified resource of %s already exists. | The specified VPC peering connection already exists. |
| 400 | OperationDenied.CloudBoxExistsInVpc | The operation is not allowed because the CloudBox device exists in vpc. | A cloud box instance exists in the initiator VPC, so it is not allowed to create a VpcPeer instance. |
| 400 | OperationDenied.CloudBoxExistsInAcceptingVpc | The operation is not allowed because the CloudBox device exists in accepting vpc. | Cloud box instances exist in the receiving end VPC, so VpcPeer instances are not allowed to be created. |
| 400 | QuotaExceeded.VpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | The number of VPC peering connections to the VPC has reached the upper limit. |
| 400 | UnsupportedRegion | The feature of %s is not supported in the region of %s. | VPC peering connections are not supported in this region. |
| 400 | QuotaExceeded.VpcPeerCountPerUserPerRegion | The quota of %s is exceeded, usage %s/%s. | The number of VpcPeer instances in a region exceeds the threshold. |
| 400 | IncorrectBusinessStatus.VpcPeer | The business status of %s [%s] is incorrect. | The current instance status is abnormal and the current operation is not allowed. |
| 400 | OperationFailed.NotExist.ResourceGroup | The operation failed because the resource group does not exist. | The operation failed because the resource group does not exist. |
| 400 | OperationFailed.AcceptUserCdtNotOpened | The operation failed because the Cdt service of accept user is not opened. | The operation failed because CDT is not activated for the peer. |
| 400 | OperationFailed.AcceptUserCrossBorderCdtNotOpened | The operation failed because the CrossBorderCdt service of accept user is not opened. | The operation failed because the cross-border service of CDT is not activated for the peer. |
| 400 | IncorrectBusinessStatus.AcceptUserVpcPeer | The business status of %s [%s] is incorrect. | The peer VPC is in an invalid business state. |
| 400 | OperationFailed.ViolativeVpcPeer | The creation operation fails because it is not allowed to create a vpc peer instance between the originating region and the receiving region. | the creation operation fails because it is not allowed to create a vpc peer instance between the originating region and the receiving region. |
| 400 | QuotaExceeded.CrossRegionVpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | The number of cross-region VpcPeer in the specified VPC exceeds the limit |
| 400 | QuotaExceeded.IntraRegionVpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | The number of VpcPeer in the same region in the specified VPC exceeds the limit |
| 400 | OperationDenied.OperateShareResource | The operation is not allowed because of operating shared resource. | Operating on shared resources causes the operation to fail |
| 400 | IncorrectBusinessStatus.AcceptVpcPeer | The business status of peer account is incorrect. | The business status of the peer VpcPeer in an invalid state. |
| 400 | OperationFailed.InterRegionLinkTypeNotSupported | The same region not supported link type feature. | Link type characteristics are not supported in the same region. |
| 400 | OperationFailed.RegionIdNotSupportLinkType | The feature link type is not supported in the region. | The gold, silver and copper settings for this feature are not supported in the region. |
| 400 | OperationFailed.SpecificLinkTypeNotSupported | The operation failed because the special link type of user is not opened. | The account does not support special link types. |
| 400 | OperationFailed.CrossBusinessNotAllowed | Operation failed because receiver and accepter belong to different business site. | |
| 400 | OperationFailed.ChargeTypeNotSupported | Operation failed because the CDT charge type of receiver or accepter does not support the Underlay link type. |
Consulte Códigos de error para ver la lista completa.
Notas de la versión
Consulte Notas de la versión para ver la lista completa.