dan
dan

Reputation: 45602

Is there a way to generate a presigned url for an S3 object using AWS CLI?

I've looked at the documentation for aws s3 and aws s3api but I can't see anything relevant to generating a presigned url. The AWS web docs only show examples for doing this with Java, .Net, and VisualStudio.

http://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURLJavaSDK.html

Upvotes: 19

Views: 15235

Answers (3)

Titi Wangsa bin Damhore
Titi Wangsa bin Damhore

Reputation: 7199

I am not sure if this is what you are looking for...

Sign an S3 URL to provide limited public access with expiry

s3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset>

http://s3tools.org/usage

It is not AWS API directly. It is a 3rd party tool.

Upvotes: 5

lbalso
lbalso

Reputation: 21

It is possible to do it with aws s3, try with the presign option. For example, if you want to get an object from a bucket, try this command:

aws s3 presign s3://bucket_name/file_name

Replace the bucket_name and file_name by the ones of the object you want to get.

Upvotes: 1

Jeroen
Jeroen

Reputation: 459

This is available native in the aws cli now: http://docs.aws.amazon.com/cli/latest/reference/s3/presign.html

Upvotes: 9

Related Questions