Introduction
Amazon Web Services (AWS) Simple Storage Service (S3) is a scalable object storage service that is used for a variety of purposes, such as application data storage, static website hosting, and content delivery. One of S3's main features is the ability to produce pre-signed URLs, which allow secure access to your objects without revealing your access credentials. This article will walk you through the steps of creating an S3 bucket and generating a pre-signed URL.
Simple illustration to understand what S3 is in AWS.
Imagine a giant online locker.
Think of S3 to be a large online storage system for storing images, movies, documents, and other types of digital data. Instead of physical items, you store digital files. Amazon Web Services (AWS) hosts this locker on the internet, allowing you to access it from anywhere worldwide as long as you have the correct key.
Before you begin, make sure your AWS account is active.
Step 1: Create an S3 Bucket
- Login to your AWS management console
- On the search buttons write S3 and click search
- Select Create Bucket.
- Enter a unique bucket name (e.g., "kosi-storage") and on the top right corner choose the AWS region of your choice, or preferably a region that is nearest to your users.
Adjust optional settings such as public access configurations, bucket versioning, encryption, bucket key, and optionally add a tag.
- Public access configurations
Note: This setting controls who can view or use the files in your bucket. Everything can be kept private or accessible just to specified people or applications. Think of it as a Do Not Disturb sign for your files.
- Bucket Versioning
Note: This is equivalent to keeping a backup of any changes you make to your data. If you mistakenly edit or delete something, you can recover the previous versions.
For the sake of the tutorial we choose click on disable
- Tags
Similar to labels, tags are applied to your bucket to help keep it organized. For instance, you could add a tag that reads Project A or Important Files so you can quickly identify what the bucket is for.
- Default Encryption
Encryption is similar to using a password to lock your files. This option ensures that all of your files are automatically locked, preventing unauthorized users from accessing and using them.
- Bucket Key
This is an efficient approach to save money and time when locking and unlocking files (encryption). It works by minimizing the number of times AWS has to check the "key" for the lock.
- Explore the object lock on the advanced settings then click on create bucket
- We have successfully created a bucket. Next, click on the newly created bucket. Instead of uploading directly, start by creating a folder to organize the files into the appropriate location before uploading them.
Step 2: Create a folder
- Click on Create a folder
- Name the folder kosinachi docs and scroll down to click on Create folder to save it.
- Folder successfully created
Note: You can create more folders using the same step
Step 3: Upload
- Click on the created folder kosinachi docs
- Click on Upload
- Click on Add files
- File added scroll down and click upload
- File uploaded successfully
Step 3: Create a Pre-Signed URL
Note: A pre-signed URL provides temporary access to a specific S3 object without revealing your AWS credentials.
- Open the image file uploaded to the kosinachi docs folder
- Click on Object actions in the top-right corner. In the dropdown menu, select Share with a pre-signed URL
- Set the duration for the pre-signed URL by choosing the number of minutes or hours you want it to remain valid. For tutorial sake, we choose 3 minutes.
- Click on Create pre-signed URL
A pre-signed URL for the “content uploaded” has been created and copied to your clipboard.
- Paste the URL into a browser to verify that it works.
This article is simple and straightforward, showing us how to create an S3 Bucket in AWS and generate a Pre-Signed URL for it. You can apply this process to any other files you’ve uploaded.
Conclusion
Creating an S3 bucket and generating pre-signed URLs on AWS is a straightforward and effective way to securely share things. This functionality offers temporary, secure access to your S3 resources. By following the steps shown above, you may effectively manage your S3 storage and securely share data.
Top comments (0)