How to get the storage class of an object stored in aws bucket

Viewed 326

I need to check the storage class of an object inside an S3 bucket.

Is there a way to get the storage class of an S3 object using the AWS CLI v2?

1 Answers

You could use list-objects-v2.

For example:

aws s3api list-objects-v2 --bucket <bucket-name> --prefix <object_key> --query "Contents[*].StorageClass" --output text

Output:

GLACIER
Related