EC2.Client.
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
)
[REQUIRED]
The ID of the subnet.
DryRunOperation
. Otherwise, it is UnauthorizedOperation
.None
Examples
This example deletes the specified subnet.
response = client.delete_subnet(
SubnetId='subnet-9d4a7b6c',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}