-
Describe the issueI recently wanted to connect an S3 bucket through boto3 and get the storage type of the bucket, but I didn't find the corresponding method, nor did I find it in the SDK description. Linkshttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @shenhongwei33, Thanks for writing! Only objects have a storage class. Buckets don't have a storage class directly associated with them, they have a lifecycle policy. You can read more about how this works here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html The related operation in the AWS CLI and the SDK is this one: https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-lifecycle-configuration.html You can read more about object storage classes here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html |
Beta Was this translation helpful? Give feedback.
-
This is a guidance question, as the documentation for this operation exists at the API level, and these are used to generate the AWS SDK and CLI documentation. Since it's a guidance question, I'm moving it to the discussion forum. If this answers your question, please mark it as answered. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @shenhongwei33,
Thanks for writing! Only objects have a storage class. Buckets don't have a storage class directly associated with them, they have a lifecycle policy. You can read more about how this works here:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html
The related operation in the AWS CLI and the SDK is this one:
https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-lifecycle-configuration.html
You can read more about object storage classes here:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html