Elimina una red privada virtual (VPC).
Descripción de la operación
Al llamar a esta operación para eliminar una VPC, tenga en cuenta los siguientes puntos:
-
Antes de eliminar una VPC, libere o migre todos los recursos en la VPC, incluidos vSwitches, instancias de servicios en la nube y direcciones IP virtuales de alta disponibilidad.
-
Solo se pueden eliminar las VPC que se encuentran en estado Available.
-
DeleteVpc es una operación asíncrona. Después de enviar una solicitud, el sistema devuelve un ID de solicitud, pero la VPC aún no se ha eliminado. La tarea de eliminación se ejecuta en segundo plano. Puede llamar a DescribeVpcAttribute para consultar el estado de eliminación de la VPC:
Si la VPC está en estado Deleting, significa que se está eliminando.
Si no se encuentra la VPC, significa que ya se ha eliminado.
-
DeleteVpc no admite la eliminación simultánea de la misma VPC.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
vpc:DeleteVpc |
delete |
*VPC
|
|
Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| VpcId |
string |
Sí |
El ID de la VPC que desea eliminar. |
vpc-bp1m7v25emi1h5mtc**** |
| RegionId |
string |
No |
El ID de región de la VPC que desea eliminar. Puede llamar a DescribeRegions para consultar el ID de región. |
cn-hangzhou |
| ForceDelete |
boolean |
No |
Especifica si se debe forzar la eliminación de la VPC. Valores válidos:
Solo puede forzar la eliminación de una VPC cuando esta contiene únicamente los siguientes recursos:
|
false |
| DryRun |
boolean |
No |
Especifica si se debe realizar una ejecución de prueba (dry run). 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 valor de ClientToken solo puede contener caracteres ASCII. Nota
Si no especifica este parámetro, el sistema utiliza el RequestId de la solicitud de API como ClientToken. El RequestId puede variar en cada solicitud de API. |
123e4567-e89b-12d3-a456-426655440000 |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
El ID de la solicitud. |
||
| RequestId |
string |
El ID de la solicitud. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Ejemplos
Respuesta exitosa
JSON Formato
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | IncorrectStatus.VpcDhcpStatus | The DhcpOptionsSet status of vpc does not support this operation. | You cannot delete the VPC when the DHCP options set of the VPC is in the current state. |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | The VPC contains endpoints and cannot be deleted. Delete the endpoints in the VPC and then delete the VPC. |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | DependencyViolation.RouteEntry | Specified object has dependent resources | The VPC cannot be deleted because custom routes exist in the VPC. |
| 400 | DependencyViolation.Instance | Specified object has dependent resources | |
| 400 | DependencyViolation.VSwitch | Specified object has dependent resources | vSwitches exist in the VPC and the VPC cannot be deleted. Delete the vSwitches and try again. |
| 400 | DependencyViolation.RouteInterface | Specified object has dependent route interface . | |
| 400 | DependencyViolation.Tunnel | Specified object has dependent tunnel. | |
| 400 | DependencyViolation.NatGateway | Specified object has dependent resources NatGateway. | NAT gateways exist in the VPC and the VPC cannot be deleted. Delete the NAT gateways and try again. |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | Security groups exist in the VPC and the VPC cannot be deleted. Delete the security groups and try again. |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | The specified VPC does not exist. |
| 400 | Forbbiden | Active custom route in vpc. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | Operations are too frequent and tasks conflict with each other. |
| 400 | InvalidAction | The VPC has been connected to the classic network ECS. Please cancel the connection before proceeding. | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | The status of the CEN instance is invalid. |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | The specified object is associated with a network ACL. |
| 400 | DependencyViolation.ClassicLinkInstance | Specified object has active classicLink instance. | |
| 400 | System.ServiceBusy | System is busy, please try later. | |
| 400 | DependencyViolation.DhcpOptionsSet | The VPC cannot be deleted when it is associated with dhcpOptionsSet. | The VPC cannot be deleted when it is associated with dhcpOptionsSet. |
| 400 | InvalidRegionId.NotFound | The specified region is not found. | The specified region does not exist. |
| 400 | DependencyViolation.CustomRouteTable | CustomRouteTable already exists. | A dependency conflict exists because custom route tables are present. |
| 400 | DependencyViolation.Ipv4Gateway | The VPC cannot be deleted when it has ipv4Gateway. | The VPC cannot be deleted because an IPv4 gateway exists in the VPC. |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | The VPC has a VPC peering connection. |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | The VPC has a reverse access and cannot be deleted. |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | The VPC failed to be deleted because a peer router interface exists in the VPC. |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | The specified resource is dependent on other resources and the current operation is not allowed. |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | The VPC cannot be deleted because it contains an IPv6 gateway. |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | The VPC cannot be deleted because it contains EPS resources. |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | The private domain name status of the current VPC does not support this operation. |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %s. | The operation is not allowed because the VPC is attached to ECR %s. |
| 400 | IncorrectStatus.RouteTableStatus | Route table [%s] status [%s] is not stable. Please try again later. | Route table [%s] status [%s] is not stable. Please try again later. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied | The operation is not supported in this status. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
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.