Accessing S3 Bucket properties

0

Hi. I am trying to access the AWS S3 bucket properties. I was looking for some SDK which I can use in my Java client and access the bucket information. The only SDK i see is listBuckets() which give all the buckets present under the account. Is there an API which gives me the requested bucket information by passing the bucket_name? Moreover, I am only looking for logging and "ObjectLock" configuration properties of a particular bucket. I know, there is a way to list all the buckets and iterate over each of them to find a right bucket but looking for a better way.

asked 7 months ago192 views
1 Answer
0

To get the properties of a specific S3 bucket in Java, you can use the AmazonS3Client's getBucketAcl and getBucketVersioning methods. see the example here. https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-objects.html

Here is the link to API doc https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Client.html

profile pictureAWS
EXPERT
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions