AWS S3

How to Setup and Use Amazon Simple Storage Service (AWS S3)?

Are you preparing for the AWS Certified Developer Associate Certification Exam? In this space, we are writing a series of articles on topics that are covered in the Developer Associate Certification Exam. So, in today’s article, we will explain one of the important concepts, that is the Amazon Simple Storage Service (AWS S3).

You may expect a lot of questions on this topic for developer associate exam. You can subscribe to our blog for receiving the updates on the next topics in this series. Let’s begin our series with the AWS S3 tutorial.

Developer Associate certification exam is the easiest exam at the associate level, it is a good idea to start your certification from this exam. Also, we would recommend you to pass the AWS Solutions Architect Certification Exam which covers the concepts of all the services offered by AWS.

TRY NOW: 25 Free Practice Questions for Developer Associate Exam

AWS Certified Developer Associate Exam Syllabus

Here is the snapshot of blueprint for AWS developer associate exam is covered in the developer associate exam.

Blueprint for AWS Certified developer associate exam

What is Amazon S3?

Amazon S3 is the object storage facility provided by AWS. Using S3 one can store any amount of data in S3 virtually. Some of the key features of Amazon S3 are:

  • It is simple to use i.e. It has a web interface which allows one to easily upload and manage objects in S3.
  • It is durable i.e. It is designed for 99.99999999% durability.
  • It is scalable i.e. You can store virtually any amount of data which can be accessed at any point in time.
  • It is designed for 99.99% availability.
  • You can have objects encrypted when uploaded to S3.
  • It can easily integrate with a host of other AWS services.
  • You can have static website hosting which allows for static webs sites to be available via the internet.

One of the key aspects of the AWS Certified Associate Developer exam is to know how to set up a static website using S3. So, let’s have a look at how we can achieve this.

Setting up Static Hosting on S3

Let’s go through the following steps to enable static hosting on S3.

  •  Log into your AWS Console. You will see the S3 section under the storage section.

AWS S3 - Storage Section

  • Create a bucket to host the objects in S3.

AWS S3 - Create BucketClick on the Create Bucket option.

  •  Give the bucket a name.

Following are the S3 bucket naming conventions

  • Bucket names must be at least 3 and no more than 63 characters long.
  • Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.). Bucket names can contain lowercase letters, numbers, and hyphens. Each label must start and end with a lowercase letter or a number.
  • Bucket names must not be formatted as an IP address (e.g. 192.168.5.4).

If you are planning to point a public DNS record to this S3 bucket, then you need to ensure the bucket name is the same as the public DNS name. For example, in the below example, we have a public domain known as its-a-new-world.com. Hence we create a bucket of the same name. This is mandatory if we want to correlate the public DNS name to our S3 bucket.

Also, you have to be aware of the fact that the S3 bucket name should not already exist in S3.

AWS S3 - Bucket Name

  •  Now create a simple html file which will be used as the index page for the website.
      <!DOCTYPE html>

      <html>

          <body>

            <h1>Hello World</h1>

          </body>

     </html>

Copy this to a file called Hello.html on your local machine.

  • Next upload this file to your bucket. Click on the Upload button.

AWS S3 - Upload File to Bucket

Choose the file in the next screen and click the Start Upload button.

AWS S3 - Upload File to Bucket

  • Next, you need to ensure that the ‘every’ ACL has the permissions to view the file. Click on the file and on the right-hand side, choose the Grantee as Everyone. Also, ensure that the Open/Download permission is provided. Click on the Save button.

AWS S3 - Upload File to Bucket

  •  Next, click on the bucket and go to Static Website hosting on the right-hand side.

AWS S3 - Static Hosting

Ensure that

  • ‘Enable website hosting’ is enabled.
  • The index document is set to Hello.html

Also, make a note of the endpoint for the static website. In our case, it’s the one given below.

 its-a-new-world.com.s3-website-ap-southeast-1.amazonaws.com

Finally, click on the Save button to ensure static website hosting is enabled.

Now when you go to the website in the browser, you can see that the site has been loaded into the browser successfully.

AWS S3 -Created Website

Now if you want your public DNS to work with this bucket from the outside world, you need to setup Route53 accordingly. The steps are shown below

  •  Go to the AWS dashboard and choose Route53 from the ‘Networking and Content Delivery’ section.

AWS S3 - Dashboard

  • Create a new hosted zone which is the same as your DNS public domain.

AWS S3- Create Hosted zone

  • Next, create a recordset which points to the S3 bucket. Ensure that the Alias option is marked as Yes. Then choose the S3 bucket website which was created in the earlier steps. You should be able to see this in the drop-down list.

AWS S3- Create Record Set

  •  Once done you have the record set in your Route53 domain.

AWS S3- Record Set

  •  Now if you want your public DNS domain to point to Route53, you need to go to your hosting provider and enter the above Name servers accordingly. So the name servers for Route 53 are

           ns-679.awsdns-20.net.

           ns-1703.awsdns-20.co.uk

           ns-74.awsdns-09.com.

           ns-1029.awsdns-00.org

So, an example is shown below. Suppose the public domain name its-a-new-world.com is hosted in Godaddy. When you manage the DNS via GoDaddy, just go to the Nameservers section and enter the above name servers.

AWs S3 - DNS Settings

Once done, whenever you browse to the URL its-a-new-world.com you will now be directed to the S3 AWS bucket.

AWS S3 Storage Classes

There are a number of storage classes offered by Amazon S3 for various use cases. These storage classes follow the S3 standard to perform the general-purpose storage of the Frequently Accessed Data, S3 One Zone-Infrequent Access, and S3 Standard Infrequent Access for long-lived while Less Frequently Accessed Data and Amazon Glacier for the long-term archive.

Amazon S3 provides lifecycle policies for the management of the stored data all over the lifecycle; these lifecycle policies are configurable. When a policy is set, the data is automatically migrated to one of the storage class that is highly appropriate without making any change to the application.

There are 5 AWS S3 Storage Classes namely –

  • AWS S3 Standard
  • AWS S3 Standard-Infrequent Access (S3 Standard-IA)
  • AWS S3 One Zone-Infrequent Access (S3 Standard-IA)
  • AWS S3 Reduced Redundancy Storage (S3 RRS)
  • AWS S3 Glacier

Let’s have a look over the features of these AWS S3 Storage Classes so that you could find the best one for storing your data in AWS Cloud:

AWS S3 Storage

Important Points to Remember about Amazon S3

  • It is designed for 99.99999999% durability.
  • It is designed for 99.99% availability.
  • It allows you to store virtually any amount of data which can be accessed at any point in time.
  • Static website hosting is possible for a bucket in S3.
  • If a public DNS name needs to point to our AWS S3 bucket then the AWS S3 bucket should have the same name as the DNS public web site.
  • Ensure to create an HTML document which will act as the index document for the website.
  • The Index document should have the ‘everyone’ to view ACL permission.
  • The S3 website hosting option will provide a URL by which one can view the website from the internet.
  • If you want the AWS S3 bucket to be available via a public domain then you need to create a Route53 zone.
  • Also, ensure that the domain provider name servers are edited and the AWS name servers are added to the list.

Summary

So, you’ve and in this article, we have covered AWS S3 tutorial how to use Simple Storage Service (Amazon S3) and Amazon S3 Storage Classes. This is one of the most important services offered by Amazon Web Services (AWS). You may expect a lot of questions on this topic in the AWS Certified Developer Associate certification exam.

Preparing for the AWS certifications exam and looking for any help? Submit your query below in the comment section or write in Whizlabs Helpdesk, we’ll get back to you. 

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top