*Please download the resources file before you proceed with the steps.
Have you ever wanted to host a static website for your company but didn’t want to pay outrageous prices? Amazon S3 can help! Hosting with Amazon S3 is free, and the only cost you will incur is if you store data over 10TB. This blog post will teach you how to host a static website using Amazon S3bucket.
There are many cloud providers, but here we are using AWS because:
- The number one reason to use AWS is that they offer a “Free Tier” which means you don’t have to worry about paying for your usage.
- The second big benefit of using AWS service is scalability and elasticity. These two things allow AWS to be able to provide high performance under tremendous load with minimal impact on functionality or latency times there’s no downtime!
- Finally, the third one is security.
There are other cloud providers out there such as Microsoft Azure and Google Cloud Platform that offer a similar service to S3. This means you can use the concepts discussed in this post with these competitors too!
What is Amazon S3?
Amazon S3 is an AWS service that provides a safe place to store your data. It’s a cloud-based storage system, so there are no limits on space and you can access it from anywhere.
Are you hungry to learn more about hosting a static website using Amazon S3 by completing a practical example? Then let’s jump in.
- Login into AWS Management Console and search S3.
- Create a new Bucket or select an existing Bucket.
To create a new bucket follow the steps given in Create S3 Bucket and Objects
- Open the S3 Bucket dashboard and upload the HTML file and click on Upload.
You can see objects uploaded in the bucket now.
- In S3 Bucket, open Properties.
6. In Edit static website hosting, select Enable to enable website hosting in AWS S3.
7. Now in Index Document specify the name of the home page or default file of the website and Error document – optionally specify the name of the file which is returned when an error occurs.
You have successfully hosted your website through S3 Bucket. You can get the website URL from Static Website Hosting in Properties.
Steps to make Bucket Objects Public:-
- Select Edit in Block public access (bucket settings) in S3 Bucket Permissions.
You have made all objects public in your Bucket.
Now we will follow a few steps to make S3 Bucket Public make it accessible for all the users. To do so we need to write a simple Bucket Policy, let’s continue…
- Inside Bucket S3 dashboard, Click on Permissions and then click on Edit in Bucket Policy.
.3. In Select Policy Type choose S3.
- In Amazon Resource Name, Copy and Paste the ARN from Edit Bucket Policy Tab. Add “/*” after the ARN to apply this to all the objects inside Bucket.
- Click on Add Statement and then on Generate Policy.
- Copy the Policy JSON Document to the Policy editor and Save Changes.
Congratulations! You have successfully configured all settings for AWS S3 Website Hosting. Now you can access your Website URL easily and publically.
The world of AWS is one you’ll want to learn more about. There’s a lot out there on the topic, and it can become difficult for those looking into getting started with such knowledge overloads in their searches.
The best way to learn AWS is by doing. Reading books isn’t enough, you need hands-on experience! That’s why I hope that this post helped you cut through all the information and gave something practical for your future in cloud development or deployment needs- because learning doesn’t stop with just reading these days. There are so many resources out there now where you can practice what was learned.
If you’re looking for a way to learn about the vast world of technology and how it works, then this post might be just what you are interested in. We’ve got information on Amazon Web Services as well! Check out our other blog posts if that’s not enough or even better yet try one of their AWS courses designed by experts who know all about these things inside-out so they can teach YOU THE SKILLZ too…
See you in the next blog. Happy Cloud computing.