S3 (Simple storage service) in AWS is an object storage service that offers industry-leading scalability, data availability, security, and performance. S3 can be used to host a static website without stressing much about the host environment.
Host static website on S3 - Hands-on
Log in to the AWS Management Console and type “S3” in the search box.
You will see an S3 dashboard, click create buckets.
The next step is to select the Region that is closest to you and enter the name of your bucket.
Click on the Create Bucket button, leave all the settings the way they are, and scroll down.
It is important to remember that a bucket’s name should always be unique and should not already exist publicly under a similar name; otherwise, your bucket will not be created.
We have created our first bucket, click on the name of the bucket to open it.
Here is a list of many of the features like Objects, Property, Permissions, Metrics, and others.
Now, let us upload our first object into our bucket in S3.
Open your browser and search HTML5 website templates & download one template.
Click on Upload & upload the template
You have to see upload on files in the bucket
You Know Index.html is main file for website... so you can try to access that file
You Will get access Denied.. So you can add the public access for bucket. Go to buckets & open permissions Make the bucket public.
After you can all Files & folders also make public .
Now you can try index.html file accessing in the browser... Now you able see one good website.
In S3 Bucket, open Properties.
Click on Edit in Static website hosting.
In Edit static website hosting, select Enable to enable website hosting in AWS S3.
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.
Click on save changes.
You have successfully hosted your website through S3 Bucket. You can get the website URL from Static Website Hosting in Properties.