Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Signed URL with Cloudfront #104

@tomasz-tomczyk

Description

@tomasz-tomczyk

Environment

  • Elixir version (elixir -v): 1.14.0-rc.0
  • Waffle version (mix deps): 1.1
  • Waffle dependencies when applicable (mix deps): N/A
  • Operating system: OSX / Alpine

Expected behavior

I was hoping to use Cloudfront with signed URLs and after configuring it in AWS, I confirmed it just works with both the Cloudfront URL and alternate domain I configured in Cloudfront by just changing the host of the URL generated by waffle/ex_aws:

App.Uploads.ProfilePhoto.url(:thumb, signed: true)
|> String.replace(
  "https://s3.eu-west-2.amazonaws.com/my-bucket-name/",
  "https://dhb50ml2ixxxx.cloudfront.net/"
)

I expected this to just happen if I was to configure the asset_host

Is there a better way to do this than add my own wrapper that changes the url?

Actual behavior

Generating a signed URL always returns a S3 URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions