AWS SDK for .NET Documentation
DeleteSubnet Method (request)
Amazon ► Amazon.EC2 ► AmazonEC2Client ► DeleteSubnet(DeleteSubnetRequest)
Did this page help you? Yes No Tell us about it...
Deletes a subnet from a VPC.
Declaration Syntax

C#

    public DeleteSubnetResponse DeleteSubnet(
    	DeleteSubnetRequest request
    )

Parameters

request (DeleteSubnetRequest)
  Delete Subnet request

Return Value
Delete Subnet Response from the service
Remarks
You must terminate all running instances in the subnet before deleting it, otherwise Amazon VPC returns an error. AWS might delete any subnet if you leave it inactive for an extended period of time (inactive means that there are no running Amazon EC2 instances in the subnet).
Exceptions

Exception | Condition
--- | ---
WebException |
AmazonEC2Exception |

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)