Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 987
dan Avatar asked Mar 05 '15 14:03

dan


People also ask

How do I create a URL for Amazon S3?

Nothing could be easier, just select all files you want to generate URLs for and click the “Web URL” button on the toolbar. You will see the list of URLs for each of the selected files. Click copy to clipboard button and you are ready to paste URLs to other programs such as an HTML files editor.

What is Presigned URL in AWS S3?

All objects and buckets are private by default. However, you can use a presigned URL to optionally share objects or allow your customers/users to upload objects to buckets without AWS security credentials or permissions. You can use presigned URLs to generate a URL that can be used to access your Amazon S3 buckets.

How do I get my S3 upload URL?

You can get the resource URL either by calling getResourceUrl or getUrl . AmazonS3Client s3Client = (AmazonS3Client)AmazonS3ClientBuilder. defaultClient(); s3Client. putObject(new PutObjectRequest("your-bucket", "some-path/some-key.

How do I find my AWS URL on my S3?

In order to get the URL of an S3 Object via the AWS Console:Navigate to the AWS S3 console and click on your bucket's name. Use the search input to find the object if necessary. Click on the checkbox next to the object's name. Click on the Copy URL button.


2 Answers

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

like image 53
Jeroen Avatar answered Oct 07 '22 11:10

Jeroen


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.

like image 44
Titi Wangsa bin Damhore Avatar answered Oct 07 '22 11:10

Titi Wangsa bin Damhore