How To Extend Duration Of Amazon S3 Signed Link In Elixir Arc — Tentamen Software Testing Blog


This post explains how to change default Elixir Arc S3 Signed Link expiration time.

Elixir Arc

Elixir Arc is a valuable Elixir library that enables developers to store files to Amazon S3 buckets from a Web application. In Arc Github readme page, there is documentation on how to create a signed URL:

# To generate a signed url:
Avatar.url({“selfie.png”, user}, :thumb, signed: true)

Signed URL is publically available, but hard to guess URL, something like this:

Link expiration parameter is X-Amz-Expires=300 where 300 is default Arc value in seconds. How to change that value? An important thing with Open Source Elixir is that readable code is publically available. We searched Arc Github repo for the word signed and we found this line:

Which gives us the following code for setting sign expiration time:

Avatar.url({“selfie.png”, user}, :thumb, [signed: true, expires_in: 36_000])

With this, we set the expiration time to ten hours.

Originally published at on August 31, 2020.

Founder of Tentamen, software testing agency.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Vertical Partition in SQL Server

File Explorer and Log Viewer & Tailer

READ/DOWNLOAD*> Compilers: Pearson New Internation

Shipping your first Web-service/app

Dlithe 21/04/2022 Experience

How to Search JSON Data from PostgreSQL

Linking Unity Project in Github

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Karlo Smid

Karlo Smid

Founder of Tentamen, software testing agency.

More from Medium

Implement Sigil in Elixir

Building a simple Calendly clone with Phoenix LiveView (pt. 4)

Comparing dates in Elixir

Intro to Elixir Functions