AWS

How to create an S3 bucket on AWS?

How to create an S3 bucket on AWS

When it comes to mind about AWS, its S3 bucket service is one of the largest and durable platforms on earth. It stands for “Simple Storage Service (S3)“, and today we are going to learn about the same. We will be looking at how to “create an S3 bucket on AWS” step-by-step.

Step 1: Select the S3 service from aws dashboard

From the AWS dashboard, search for the “S3” under “Services” menu, and select it. For reference, look at the picture below.

Select the S3 service form AWS dashboard
Select the S3 service form AWS dashboard

Step 2: Create S3 bucket

After getting into the “S3 dashboard“, click on the “+ Create bucket” icon, as shown in the screenshot below.

From AWS S3 console select Create Bucket Icon
From AWS S3 console select Create Bucket Icon

After clicking the button mentioned above, you will be seeing a screen like this on your dashboard.

On this screen, we have set the following details:

  • Bucket name = “practice-geekylane”
  • Region = US East (N. Virginia)
  • Copy settings from an existing bucket = Leave Blank as of now

Note: The “bucket name” have to unique on your side because it is going to be a real DOMAIN NAME.

After filling up the details, click on “Next“.

Create a S3 bucket with a name practice-geekylane
Create an S3 bucket with a name “practice-geekylane”

Now, you will be seeing a window like this, on this, do not change any options, leave it as they are already.

Question: Why we are not changing anything here?

Answer: Because we are going to change these later in this post.

On this window leave it as it is
On this window leave it as it is

Now, you will see a “set permissions” screen,, leave it as it is.

As of now leave all the permissions as they are by default
As of now leave all the permissions as they are by default

Before proceeding further, you will see a “Review” screen as shown below. After cross-checking the details we have set so far for our “practice-geekylane” bucket, click on the “Create bucket” icon.

Review the S3 bucket and click on Create Bucket
Review the S3 bucket and click on Create Bucket

Step 3: Upload files to S3 bucket

Now that our “practice-geekylane” bucket is successfully created, we are now going to add some data to it.

Question: What is the meaning of “Adding data to the S3 bucket“?

Answer: It means that we are now going to upload some files (referred to as data) to our newly created “practice-geekylane“.

In order to add data to “practice-geekylane“, click on the bucket name as shown in the image below.

Our practice-geekylane bucket has been created
Our practice-geekylane bucket has been created

After clicking there, a screen like shown below is going to be there on your side as well.

From this screen, click on the “Upload” button, and you will be prompted to your OS’s “File Manager” from there, navigate to the file which you want to upload to your S3 bucket.

This the the bucket we just create and we can upload the files in here
This the the bucket we just create and we can upload the files in here

We have selected and uploaded a file named “GL logo.jpg“, from the picture below you can see.

After selecting the file from your system, click on the “Upload” button as shown in the screenshot.

Upload GL logo jpeg file to practice-geekylane bucket
Upload GL logo jpeg file to practice-geekylane bucket

Confirmation, in your case also you will be seeing a “100% Successful” message like shown in the picture below.

File is successfully uploaded in the practice-geekylane S3 bucket
File is successfully uploaded in the practice-geekylane S3 bucket

Step 4: Access the file stored in an S3 bucket

Now, it is time to access our recently uploaded file “GL logo.jpg” to the “practice-bucket“.

In order to do that, click on the “checkbox” of the file name you uploaded, in our case, it is “checkbox” for “GL logo.jpg“. You will be seeing a “key = Object URL“.

Check the information of the file by clicking on it and go to the object URL
Check the information of the file by clicking on it and go to the object URL

After copying the “Object URL“, when we pasted it in the “URL bar” of the browser, you can see that we are getting an error message “Access Denied“.

When we try to access the file it gives us the Access Denied error
When we try to access the file it gives us the Access Denied error

Question: Why accessing the “GL logo.jpg” file is give an “Access Denied” error?

Answer: Because we have not set any permissions on the “GL logo.jpg” file.

Step 5: Making public the file stored in an S3 bucket

In order to change the permissions of a file stored in an S3 bucket, do as shown below. Click on the “checkbox” of the image, after that click on “Actions“, from there you will be seeing a drop-down menu having an option as “Make public” click on that.

Make the S3 bucket public from S3 console
Make the S3 bucket public from S3 console

Before making the file public, it is going to give you a message as shown in the image below, simply click on the “Make public” icon, to make it public.

Confirmation message for making a S3 bucket public
Confirmation message for making a S3 bucket public

Wait! what? -> it is again giving an error, this time on making the file public, for reference check the picture below.

Question: Why is it giving the error?

Answer: It is because we have not set the permissions of the “practice-geekylane“, so in order to make any permissions change on the files stored in the “practice-geekylane“, we have to first change its permissions.

Unable to make a S3 bucket public 100% Failed
Unable to make an S3 bucket public 100% Failed

Step 6: Making the S3 bucket public

Traverse to your bucket, as we did in our case, now click on the “practice-geekylane” bucket and from there click on the “Edit public access settings” in order to make permissions work on files stored in it.

Edit public access setings of a S3 bucket
Edit public access setings of a S3 bucket

Again, do note that we are leaving the “check-boxes” “untick“, as shown below, and click on the “Save” icon. This will result in making the “practice-geekylane” public.

ACLs and Bucket Policies are unchecked by default
ACLs and Bucket Policies are unchecked by default

It will again be going to give you a confirmation message, type “confirm” and click on “Confirm” button.

Confirm the public access change for a S3 bucket
Confirm the public access change for an S3 bucket

Step 7: Repeat “Step 5”

We are going to do the same as we did in “Step 5“.

Again Make the GL logo jpeg file public
Again Make the “GL logo.jpg” file public

Check the screenshot, it is now completed with a “100% Successful” message.

Making the file is as public is now successful
Making the file is as public is now successful

Now, again access the “URL” pasted in the “URL bar“, you will now able to access the file stored in S3 publicly. In our case, the file “GL logo.jpg” is now publicly accessible.

The GL logo jpeg can be seen via the object url
The “GL logo.jpg” can be seen via the object url

Conclusion for “Create an S3 bucket on aws”

  • You will be given a confirmation message every time you make changes to your S3 bucket permissions (ACLs or Bucket policies).
  • By default, public access is denied for S3 bucket and its files.

More on AWS:

Comment here