Cria uma conexão de peering de VPC.
Descrição da operação
Antes de criar uma conexão de peering de VPC, observe os seguintes itens:
-
CreateVpcPeerConnection é uma operação assíncrona. O sistema retorna um ID de instância, mas a conexão IPsec ainda não foi criada e executa a tarefa em segundo plano. Chame GetVpcPeerConnectionAttribute para consultar o status da tarefa.
-
Se a conexão de peering de VPC estiver no estado Creating, a conexão de peering de VPC está sendo criada.
-
Se a conexão de peering de VPC estiver no estado Activated, a conexão de peering de VPC foi criada.
-
Se a conexão de peering de VPC estiver no estado Accepting, trata-se de uma conexão entre contas. A conexão precisa ser aceita no lado do aceitador.
-
-
Você não pode chamar CreateVpcPeerConnection repetidamente dentro do período de tempo especificado.
Ao criar uma conexão de peering de VPC, o sistema ativa automaticamente o Cloud Data Transfer (CDT) para você.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
vpc:CreateVpcPeerConnection |
create |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| RegionId |
string |
Sim |
O ID da região onde você deseja criar uma conexão de peering de VPC. Chame a operação DescribeRegions para consultar a lista de regiões mais recente. |
cn-hangzhou |
| VpcId |
string |
Sim |
O ID da VPC solicitante. |
vpc-bp1gsk7h12ew7oegk**** |
| AcceptingAliUid |
integer |
Sim |
O ID da conta Alibaba Cloud à qual a VPC aceitadora pertence.
Nota
Se o aceitador for um usuário RAM, defina AcceptingAliUid como o ID da conta Alibaba Cloud que criou o usuário RAM. |
1210123456123456 |
| AcceptingRegionId |
string |
Sim |
O ID da região da VPC aceitadora da conexão de peering de VPC que você deseja criar.
|
cn-hangzhou |
| AcceptingVpcId |
string |
Sim |
O ID da VPC aceitadora. |
vpc-bp1vzjkp2q1xgnind**** |
| Name |
string |
Não |
O nome da conexão de peering de VPC. O nome deve ter de 2 a 128 caracteres e pode conter dígitos, sublinhados (_) e hifens (-). Deve começar com uma letra. |
vpcpeer |
| Description |
string |
Não |
A descrição da conexão de peering de VPC. A descrição deve ter de 2 a 256 caracteres. A descrição deve começar com uma letra, mas não pode começar com |
description |
| DryRun |
boolean |
Não |
Especifica se deve ser realizado apenas um dry run, sem executar a solicitação real. Valores válidos:
|
false |
| ClientToken |
string |
Não |
O token de cliente usado para garantir a idempotência da solicitação. Você pode usar o cliente para gerar o token, mas deve garantir que o token seja exclusivo entre diferentes solicitações. O token pode conter apenas caracteres ASCII e não pode exceder 64 caracteres de comprimento. Nota
Se você não especificar este parâmetro, o sistema usará automaticamente o ID da solicitação como o token do cliente. O ID da solicitação pode ser diferente para cada solicitação. |
02fb3da4-130e-11e9-8e44-001**** |
| ResourceGroupId |
string |
Não |
O ID do grupo de recursos. Para obter mais informações sobre grupos de recursos, consulte Grupos de recursos. |
rg-acfmxazb4ph6aiy**** |
| Bandwidth |
integer |
Não |
A largura de banda da conexão de peering de VPC. Unidade: Mbit/s. O valor deve ser um número inteiro maior que 0. Antes de especificar este parâmetro, certifique-se de criar uma conexão de peering de VPC inter-regional. |
100 |
| LinkType |
string |
Não |
O tipo de link da conexão de peering de VPC que você deseja criar. Valores válidos:
Nota
|
Gold |
| Tag |
array<object> |
Não |
As tags. |
|
|
object |
Não |
As tags. |
||
| Key |
string |
Não |
A chave da tag. Você deve especificar pelo menos uma chave de tag e no máximo 20 chaves de tag. A chave da tag não pode ser uma string vazia. A chave da tag pode ter até 128 caracteres de comprimento. Não pode começar com |
FinanceDept |
| Value |
string |
Não |
O valor da tag. Você deve especificar pelo menos um valor de tag e pode especificar no máximo 20 valores de tag. O valor da tag pode ser uma string vazia. O valor da tag pode ter até 128 caracteres de comprimento. Não pode começar com |
FinanceJoshua |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
O ID da solicitação. |
||
| RequestId |
string |
O ID da solicitação. |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
| InstanceId |
string |
O ID da instância na qual a conexão de peering de VPC é criada. |
pcc-lnk0m24khwvtkm**** |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
"InstanceId": "pcc-lnk0m24khwvtkm****"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 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 Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.