Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DeleteSubnet

Description

Deletes a subnet from a VPC. You must terminate all running instances in the subnet before deleting it, otherwise the API action returns an error.

Request Parameters

SubnetId

The ID of the subnet.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a DeleteSubnetResponse element.

requestId

The ID of the request.

Type: xsd:string

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example deletes the subnet with ID subnet-9d4a7b6c.

https://ec2.amazonaws.com/?Action=DeleteSubnet
&SubnetId=subnet-9d4a7b6c
&AUTHPARAMS

Example Response

<DeleteSubnetResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">							
   <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
   <return>true</return>
</DeleteSubnetResponse>