deleteVolume

inline suspend fun Ec2Client.deleteVolume(crossinline block: DeleteVolumeRequest.Builder.() -> Unit): DeleteVolumeResponse

Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).

The volume can remain in the deleting state for several minutes.

For more information, see Delete an Amazon EBS volume in the Amazon EBS User Guide.

Samples


fun main() { 
   //sampleStart 
   // This example deletes an available volume with the volume ID of vol 049df61146c4d7901 If the command
// succeeds, no output is returned.
val resp = ec2Client.deleteVolume {
    volumeId = "vol-049df61146c4d7901"
} 
   //sampleEnd
}