describeVolumes

Describes the specified EBS volumes or all of your EBS volumes.

If you are describing a long list of volumes, we recommend that you paginate the output to make the list more manageable. For more information, see Pagination.

For more information about EBS volumes, see Amazon EBS volumes in the Amazon EBS User Guide.

We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts.

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

Samples

import aws.sdk.kotlin.services.ec2.model.Filter

fun main() { 
   //sampleStart 
   // This example describes all of your volumes in the default region.
val resp = ec2Client.describeVolumes() 
   //sampleEnd
}
import aws.sdk.kotlin.services.ec2.model.Filter

fun main() { 
   //sampleStart 
   // This example describes all volumes that are both attached to the instance with the ID i
// 1234567890abcdef0 and set to delete when the instance terminates.
val resp = ec2Client.describeVolumes {
    filters = listOf<Filter>(
        Filter {
            values = listOf<String>(
                "i-1234567890abcdef0"
            )
            name = "attachment.instance-id"
        },
        Filter {
            values = listOf<String>(
                "true"
            )
            name = "attachment.delete-on-termination"
        }            
    )
} 
   //sampleEnd
}