Raman
Raman

Reputation: 226

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.

Upvotes: 3

Views: 4213

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269111

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.

Upvotes: 7

Related Questions