Static Website Hosting
AWS Services
- Amazon Certificate Manager
- Amazon CloudFront
- Amazon S3
Summary
You are required to host a static website on AWS. The website should be served over HTTPS and should be globally distributed. You should also ensure that the website is highly available and protected against DDoS attacks. The website should consist of two pages: an index page (index.html) and a contact page (contact.html). When a user visits the root of the website, they should see the index page.
Task
You’ve been tasked with hosting a secure, globally accessible static website for a new product launch.
- Create an S3 bucket named
skills53-static-siteand upload the providedindex.htmlandcontact.htmlfiles. - Configure the S3 bucket for static website hosting.
- Use Amazon CloudFront to distribute the website globally:
- Configure CloudFront to use the S3 bucket as the origin.
- Enforce HTTPS for all requests.
- Attach an Amazon Certificate Manager (ACM) public certificate if using a custom domain, or use the default CloudFront domain for testing.
- Ensure
index.htmlis configured as the default root object.
Verification:
- Confirm that accessing the CloudFront URL serves the
index.htmlpage by default. - Verify that the
contact.htmlpage is accessible directly via its URL. - Ensure all requests are served over HTTPS.
Hints:
- Never use Private CA in ACM, as it is costly. Use a public ACM certificate or stick to the default CloudFront domain.
- The “default root object” in CloudFront determines which file is served when a user accesses the root of the domain.
- Use the S3 Management Console to upload files and enable static website hosting.
- CloudFront distributions take time to deploy. Plan your testing accordingly.
Last updated on