Get ARN of S3 Bucket with aws cli

Amazon Web-ServicesAmazon S3Aws Cli

Amazon Web-Services Problem Overview


Is it possible to get the ARN of an S3 bucket via the AWS command line?

I have looked through the documentation for aws s3api ... and aws s3 ... and have not found a way to do this.

Amazon Web-Services Solutions


Solution 1 - Amazon Web-Services

It's always arn:PARTITION:s3:::NAME-OF-YOUR-BUCKET. If you know the name of the bucket and in which partition it's located, you know the ARN. No need to 'get' it from anywhere.

The PARTITION will be aws, aws-us-gov, or aws-cndepending on whether you're in general AWS, GovCloud, or China resepectively.

Solution 2 - Amazon Web-Services

You can also select your S3 bucket ARN by selecting it using the tick mark at the s3 management console, which will pop up a Side bar. where there is a provision to copy your S3 bucket ARN.S3 management console with bucket ARN

Solution 3 - Amazon Web-Services

aws articles spell out the arn format but never say go here to see it. Highlighting my s3 bucket and seeing that Copy Bucket ARN kept me sane for a few more hours.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionljcundiffView Question on Stackoverflow
Solution 1 - Amazon Web-ServicesSergey KovalevView Answer on Stackoverflow
Solution 2 - Amazon Web-ServicesjovelView Answer on Stackoverflow
Solution 3 - Amazon Web-ServicesdeawarView Answer on Stackoverflow