Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

delete_subnet

delete_subnet(**kwargs)

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

See also: AWS API Documentation

Request Syntax

response = client.delete_subnet(
    SubnetId='string',
    DryRun=True|False
)
Parameters
  • SubnetId (string) --

    [REQUIRED]

    The ID of the subnet.

  • DryRun (boolean) -- Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .
Returns

None

Examples

This example deletes the specified subnet.

response = client.delete_subnet(
    SubnetId='subnet-9d4a7b6c',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}