Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ARN string from s3Object

How would I be able to get Arn String from a s3object

I could probably do this myself, but want to use if some methods already exists to do this.

like image 579
Raman Avatar asked Mar 23 '26 13:03

Raman


1 Answers

An ARN for an Amazon S3 object is in the form:

arn:aws:s3:::BUCKET-NAME/filename-including-path

For example:

arn:aws:s3:::acme-inc/staff_photos/bob.jpg

The generic format for an ARN is:

arn:aws:SERVICE-NAME:REGION:ACCOUNT:RESOURCE

Given the name of an Amazon S3 bucket (which is globally unique), the system can determine the Region and Account, so those fields can be left blank when referring to an S3 bucket/object.

like image 178
John Rotenstein Avatar answered Mar 26 '26 13:03

John Rotenstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!