Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 pre signed URL without Expiry date

Is there any way that I can generate Pre-Signed URL's without any expiry date ? I'm developing a Email app where my attachments will be saved in S3. Also please let me know what is the best way to download attachments via JavaScript SDK.

I'm using below code

var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; var url = s3.getSignedUrl('getObject', params); console.log('The URL is', url); 
like image 561
srinisunka Avatar asked Jun 03 '14 11:06

srinisunka


People also ask

Do pre-signed URLs expire?

Resolution. If you created a presigned URL using a temporary token, then the URL expires when the token expires. The URL expires even if the URL was created with a later expiration time.

How many times can a Presigned URL be used?

It grants restricted access — only one of GET or PUT is allowed for a single URL. Only to a single object — each pre-signed URL corresponds to one object. With a time-constrained — the URL expires after a set timeout.

What is pre-signed URL in S3?

A presigned URL gives you access to the object identified in the URL, provided that the creator of the presigned URL has permissions to access that object.

How do you check S3 URL is valid or not?

You can simply do an HTTP head request to check whether the url exist.


1 Answers

The maximum expiration time for presigned url is one week from time of creation. So there is no way to have a presigned url without expiry time.

like image 110
yottabytt Avatar answered Nov 08 '22 18:11

yottabytt