Bootstrap FreeKB - Amazon Web Services (AWS) - List Elastic Block Storage (EBS) Volumes using the AWS CLI
Amazon Web Services (AWS) - List Elastic Block Storage (EBS) Volumes using the AWS CLI


This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

By default, when you create a new EC2 instance, the file system being used by the EC2 instance will be an Elastic Block Storage (EBS) Volume. This can be seen on the Storage tab of your EC2 instance.

 

The aws ec2 describe-volumes command can be used to list your Elastic Block Storage (EBS) Volumes.

aws ec2 describe-volumes

 

And here is an example of how to limit the output using the --query option.

aws ec2 describe-volumes --query 'Volumes[?VolumeId==`vol-0d989fe3bad4dd2f9`]'

 

Something like this should be returned.

[
    {
        "AvailabilityZone": "us-east-1b",
        "Attachments": [
            {
                "AttachTime": "2023-07-28T19:58:37.000Z",
                "InstanceId": "i-0a3ea97aa2383de58",
                "VolumeId": "vol-0d989fe3bad4dd2f9",
                "State": "attached",
                "DeleteOnTermination": true,
                "Device": "/dev/xvda"
            }
        ],
        "Encrypted": false,
        "VolumeType": "gp3",
        "VolumeId": "vol-0d989fe3bad4dd2f9",
        "State": "in-use",
        "Iops": 3000,
        "SnapshotId": "snap-096dd96dde7d24189",
        "CreateTime": "2023-07-28T19:58:37.544Z",
        "MultiAttachEnabled": false,
        "Size": 8
    }
]

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 07bee0 in the box below so that we can be sure you are a human.