DEV Community

Cover image for Effortless File Management: Setting Up AWS S3 Buckets and Presigned URLs

Effortless File Management: Setting Up AWS S3 Buckets and Presigned URLs

Table of Contents

Introduction

Simple Storage Service (S3) is a service on Amazon Web Services (AWS) that provides a robust solution for storing, organizing, and accessing files in the cloud. With S3, you can create scalable storage buckets, upload files, and manage access effortlessly. One of the standout features of AWS S3 is the ability to generate presigned URLs, which allow temporary and secure access to files without exposing your bucket or file permissions.
S3
By the end of this guide, you’ll not only have a functional S3 bucket but also the knowledge to share files securely and optimize your storage management strategy. Let's dive in!


Prerequisites

  • Go to the AWS management console.
  • Sign up if you don't already have an account.
  • Sign in to your account with your credentials. Sign in

Step 1: Creating and Configuring S3 Bucket

  • After you're logged in, search S3 and select the highlighted option.
    search S3

  • Click on the Create bucket button.
    Create bucket

  • Give the bucket a globally unique name e.g., tourism-s3. (You should go over the bucket naming rules.)

  • You can change the region from the top right corner.
    Name and Region

  • For security, we will block public access to our bucket. (Uncheck the box is creating a public bucket.)

  • Disable bucket versioning. It can be enabled if you need multiple copies of a file stored in the bucket for retrieval purposes.
    Access & Version

  • Let's add a tag for cost management. (Here Name is the Key and tourism is the Value.)

  • For encryption and other settings we leave as default.

  • Click the Create bucket button.
    Tags and other settings

  • We successfully created a bucket. Click on the bucket to open.
    Open bucket


Step 2: Creating Folders

  • Click Create folder and let's create folders to store pictures, tables, & videos.
    Create folder

  • Give the folder a name tour-pictures and click Create folder to save.
    Picture folder

  • Create a folder for tables and videos using the same steps.
    Table folder
    Video folder

  • We successfully created folders for different purposes.
    Folders Created


Step 3: Uploading Files

  • Open the tour-pictures folder and click on Upload.
    Open tour-pictures

  • Click Add files and select an image.
    Image

  • At the bottom right of the page, click Upload.
    Image upload
    Upload successful

  • Let's upload a table as well. Open the tour-tables folder and click Upload.
    Table upload

  • Click Add files and select a table file.
    Table

  • Click Upload and notice you now have the table in your tour-tables folder.
    Upload
    Successful


Step 4: Creating Presigned URLs

  • Open the image file Uploaded to tour-pictures.
  • Click Object actions at the top right.
  • In the drop down select Share with a presigned URL.
    Image file

  • Set the Number of minutes or hours you want the presigned URL to last for. Setting ours to 30 minutes.

  • Click Create presigned URL.
    Configure the URL

  • Copy the presigned URL.
    Copy the URL

  • Paste the URL in a browser to test it works.
    AWS cloud muscles

  • Now let's do the same for our table. Open the table file in tour-tables

  • Click Object actions at the top right.

  • In the drop down select Share with a presigned URL.
    Table file

  • Just like the image, set the Number of minutes or hours you want the presigned URL to last for. Setting it to 30 minutes here as well.

  • Click Create presigned URL.
    Configure URL

  • Copy the presigned URL.
    Copy URL

  • Paste the URL in a browser to test it works (it should download the table file we uploaded).
    Table File testing


Conclusion

In this article, we created an AWS S3 bucket, organized files with folders, uploaded files, and generated presigned URLs for secure sharing. These steps make managing and sharing files in the cloud simple and secure.

With these skills, you’re ready to use AWS S3 effectively and explore more advanced features for your cloud storage needs.

Note: We can delete the S3 bucket after Use for cost-saving purposes

  • Select the S3 bucket and click delete. Delete S3 bucket

Delete S3 successful


Thank you for reading my blog.😊😊

If you need further assistance, feel free to reach out in the comment or hit me up on Twitter. You can also follow me on GitHub. My DM's are open and love discussions on cloud topics!😁

: Oluwatofunmi Emmanuel Oluwaloseyi

Top comments (0)