how to create Cloudfront signedUrl?

Posted 1 month ago by michaelnguyen547

I am working with CloudFront to serve content from S3.

WIth S3 only

Storage::disk('s3')->url($image_path); // return a normal s3 url - correct

Storage::disk('s3')->temporaryUrl($image_path, now()->addMinutes(30)) // return S3 signed url - correct

With CloudFront (Restrict Bucket Access is on, Restrict Viewer Access is on Use Signed URLs or Signed Cookies)

Storage::disk('s3')->url($image_path); // return a normal CloudFront url - correct

Storage::disk('s3')->temporaryUrl($image_path, now()->addMinutes(30)) // return S3 signed url - incorrect . I expect CloudFront signed url

any idea how to get a signed URL CloudFront? (example from AWS PHP library https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.CloudFront.UrlSigner.html)

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.