Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ARN of S3 Bucket with aws cli

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.

like image 619
ljcundiff Avatar asked Dec 20 '16 23:12

ljcundiff


People also ask

How do I get an S3 Arn from AWS CLI?

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-cn depending on whether you're in general AWS, GovCloud, or China resepectively.

What is S3 bucket Arn?

The ARN is a unique identifier that helps users identify specific resources present within AWS. Regarding the S3 ARN, if can be divided into 3 sections – the partition, the service name, and then the relative ID. In the context of Amazon S3, it would look something like this: arn:aws:s3:::bucket_name/key_name.

Where do I find my Arn on aws?

Open the Amazon Connect console at https://console.aws.amazon.com/connect/ . On the instances page, choose the instance alias. The instance alias is also your instance name, which appears in your Amazon Connect URL. On the Account overview page, in the Distribution settings section, you can see the full instance ARN.


1 Answers

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.

like image 54
Sergey Kovalev Avatar answered Oct 25 '22 03:10

Sergey Kovalev