Sharing Private Files Securely with Pre-Signed URLs in S3 (AWS Console)

By Łukasz Kallas
Picture of the author
Published on
aws image

Sometimes you need to share private files stored in an S3 bucket without making them public. In such cases, you can use pre-signed URLs to grant temporary, secure access to these files.

What is a Pre-Signed URL?

A pre-signed URL allows anyone with the link to download or upload a specific file in an S3 bucket for a limited time. It keeps your files private while giving temporary access when needed.

Why Use Pre-Signed URLs?

  • Secure: Your S3 objects remain private, with access controlled through the link.
  • Time-Limited: You decide how long the link is valid.
  • Flexible: Pre-signed URLs can be used for both download and upload actions.

Steps for Creating and Using Pre-Signed URLs with AWS Management Console

Step 1: Log In to AWS Console

Go to the AWS Management Console and log in with your credentials.

Step 2: Navigate to Amazon S3

In the search bar, type "S3" and select S3 from the services list. This will take you to the S3 dashboard where you can view your buckets.

Step 3: Select Your Bucket and Object
  • Choose the S3 bucket that contains the private file you want to share.
  • Navigate to the object (file) within the bucket.
Step 4: Generate the Pre-Signed URL
  • Select the object by clicking on its name.
  • On the object details page, click the Actions dropdown menu.
  • Select Generate Pre-signed URL.
  • Specify the expiration time for the URL (you can set it up to 7 days).
  • Click Generate URL.

The console will display the pre-signed URL, which you can copy and share with the recipient.

Step 5: Access the File

The recipient can use the pre-signed URL to access the file via their browser or any other tool that supports HTTP requests. Once the URL expires, access will be automatically revoked.

Stay Tuned

Want to learn?
The best articles, links and news related to software development delivered once a week to your inbox.