deleteSubnet 
  inline suspend fun Ec2Client.deleteSubnet(crossinline block: DeleteSubnetRequest.Builder.() -> Unit): DeleteSubnetResponse
Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.
Samples
fun main() { 
   //sampleStart 
   // This example deletes the specified subnet.
ec2Client.deleteSubnet {
    subnetId = "subnet-9d4a7b6c"
} 
   //sampleEnd
}