Amazon S3 allows us to host a static website. Static HTML pages can be deployed on S3 and using the scripting language (such as JavaScript) we can make it a dynamic website. For hosting, we need to configure the bucket website configuration and map our domain name to redirect the request to the Amazon S3 bucket.
Let's see how we can host a static website on Amazon S3.
Let's see how to host a static website on Amazon S3:
- Create the S3 bucket and grant public access: Create a bucket with the name
www.blog.tweakings3.com
and grantPublic
permissions so that anonymous users can access the HTML files:
Figure 4.18: Create Bucket (www.blog.tweakings3.com)
Figure 4.19: Bucket Policy
Add the following policy and click on Save
:
{ "Version": "2012-10-17", "Statement": [{ "Sid": "AddPerm...