how to create Cloudfront signedUrl?

Posted 8 months 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.