veilupearl
veilupearl

Reputation: 929

What is the maximum expiration time for CloudFront signed url

I'm using CloudFront for generating signed URL from this doc what is the maximum expiration time for CloudFront signed URL? How should I mention on this DateLessThan argument

Sample Code snippet

String signedUrlCanned = CloudFrontService.signUrlCanned(
    "http://" + distributionDomain + "/" + s3ObjectKey, // Resource URL or Path
    keyPairId,     // Certificate identifier, 
                   // an active trusted signer for the distribution
    derPrivateKey, // DER Private key data
    ServiceUtils.parseIso8601Date("2011-11-14T22:20:00.000Z") // DateLessThan
    );
System.out.println(signedUrlCanned);

Note: It should be a permanent URL like Instagram cdn URL

Upvotes: 4

Views: 7303

Answers (1)

jogold
jogold

Reputation: 7417

There is no maximum expiration time for CloudFront signed URLs but you always have to specify the DateLessThan parameter.

CloudFront requires this value to prevent users from having permanent access to your private content.

In order to have a permanent-like URL you should set the DateLessThan far in the future.

Also see When Does CloudFront Check the Expiration Date and Time in a Signed URL? and Creating a Signed URL Using a Custom Policy

Upvotes: 4

Related Questions