How to create a private downloadable link to S3 objects

Viewed 2244

I am having an S3 bucket with private access containing all audio and video files. Now I want to add a download file functionality in a website. So, I am looking for a way to get a downloadable URL to each S3 object without making them public. The link should only be accessed by passing a token in the query parameter like below.

<Link to the S3 bucket object>/?token=<short lived token>

I have checked many links but all were talking about creating a publically accessible bucket. I can't find any way to do it from a private bucket. Please let me know if you have any suggestions.

Note: Once I get a downloadable URL to the S3 object. I will also use it for streaming audio and video.

1 Answers

AWS S3 has functionality for this via the CLI/SDK, Signed URLs.

By signing a URL it has a fixed duration it can be public for (assuming the attached token is added in the query string). You will need to generate this each time you want to share this URL.

Related