Static Web Hosting In An Amazon S3 Bucket
Amazon S3 is an online, container-based object storage service that can be used to store directories and files like on a PC.
To work with Amazon S3 you need to create S3 buckets (containers) and then create folders and upload files.
Additionally, Amazon S3 can also be used to host static websites by enabling a specific bucket configuration and security policy.
Step 1 – Launch S3 Bucket Web Hosting for a Static Website
Sign-in to your user account and navigate to the S3 Bucket Websites section.
Under the Launcher sub-section, give your static web hosting bucket a unique friendly name to identify it.
IMPORTANT – Provide the domain/sub-domain you wish to use with this S3 bucket website so that it can be used as the bucket name to enable mapping later. If you need to register a new domain name for the purpose, click here.
Then hit the Launch button to set it all up. Thats all!
Your S3 static web hosting is ready for you to publish your website.
Step 2 – Configure Custom Domain/Sub-domain
Next you need to point a sub-domain to the S3 bucket hosting.
Lets say you provided a sub-domain name app01.iwebz.net in the Domain Name field in Step 1.
When we configure your S3 bucket we will also create an S3 bucket endpoint using the sub-domain you provided.
Next you need to add a CNAME record in your DNS settings to match the sub-domain.
For this navigate to the S3 Bucket Websites section and note the S3 Bucket Website Endpoint (CNAME Target).
Now go to your Domain Management control panel and add the sub-domain with Value/Content same as the CNAME target you noted above.
After 2-3 hours when this record propagates globally, you can use it to access your S3 bucket website.