describeSubnets

abstract suspend fun describeSubnets(input: DescribeSubnetsRequest = DescribeSubnetsRequest { }): DescribeSubnetsResponse

Describes your subnets. The default is to describe all your subnets. Alternatively, you can specify specific subnet IDs or filter the results to include only the subnets that match specific criteria.

For more information, see Subnets in the Amazon VPC User Guide.

Samples

import aws.sdk.kotlin.services.ec2.model.Filter
fun main() { 
   //sampleStart 
   // This example describes the subnets for the specified VPC.
val resp = ec2Client.describeSubnets {
    filters = listOf<Filter>(
        Filter {
            name = "vpc-id"
            values = listOf<String>(
                "vpc-a01106c2"
            )
        }            
    )
} 
   //sampleEnd
}