Deletes a virtual private cloud (VPC) peering connection.

Usage notes

  • You can delete VPC peering connections. After you delete a VPC peering connection, your service is affected. Proceed with caution.
    • If you forcefully delete a VPC peering connection, the system deletes the routes that point to the VPC peering connection from the VPC route table.
    • If you do not forcefully delete a VPC peering connection, the system does not delete these routes. You must manually delete them.
  • The DeleteVpcPeerConnection operation is asynchronous. After you send a request, the system returns RequestId, but the operation is still being performed in the background. You can call the GetVpcPeerConnectionAttribute operation to query the status of a VPC peering connection.
    • If a VPC peering connection is in the Deleting state, it is being deleted.
    • If a VPC peering connection is in the Deleted state, it is deleted.
  • You cannot repeatedly call the DeleteVpcPeerConnection operation for the same VPC peering connection within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DeleteVpcPeerConnection

The operation that you want to perform. Set the value to DeleteVpcPeerConnection.

InstanceId String Yes pcc-lnk0m24khwvtkm****

The ID of the VPC peering connection that you want to delete.

Force Boolean No false

Specifies whether to forcefully delete the VPC peering connection. Valid values:

  • false (default): no.
  • true: yes. If you forcefully delete the VPC peering connection, the system deletes the routes that point to the VPC peering connection from the VPC route table.
DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails to pass the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the check, an HTTP 2xx status code is returned and the operation is performed.
ClientToken String No 02fb3da4-130e-11e9-8e44-001****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters.

Note If you do not set this parameter, the system uses RequestId as ClientToken. The value of RequestId for each API request may be different.

Response parameters

Parameter Type Example Description
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DeleteVpcPeerConnection
&InstanceId=pcc-lnk0m24khwvtkm****
&Force=false
&DryRun=false
&ClientToken=02fb3da4-130e-11e9-8e44-001****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteVpcPeerConnectionResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</DeleteVpcPeerConnectionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

For a list of error codes, visit the API Error Center.