Hosting Static Websites on Amazon S3
- Amazon S3 Static Website Hosting:
- S3 can host static websites, making them accessible on the internet.
- Websites are served directly from an S3 bucket.
- URL Structure:
- The URL of the hosted website depends on the AWS region.
- There are subtle differences in the URL structure:
- Some URLs may use a dash (``).
- Others may use a dot (
.).
- Memorization of the URL structure is not crucial, but it's good to be aware.
- Bucket Configuration:
- An S3 bucket is used to store the website's files (e.g., HTML, images).
- The bucket must be configured to enable website hosting.
- Accessing the Website:
- The website will have a corresponding URL through which users can access the S3 bucket's contents.
- Public read access must be enabled for the website to be accessible.
- If there is a
403 Forbidden error, it indicates that the bucket is not public.
- S3 Bucket Policy:
- A bucket policy must be attached to the S3 bucket to make it publicly readable.
- The policy enables users to view the website without authentication.
- Next Steps:
- The lecture will be followed by a hands-on session to practice website hosting with S3.
Note: Always ensure that making your S3 bucket public is in line with your organization's security policies, as public buckets can expose your data to anyone on the internet.
If your Amazon S3 bucket is configured as a website endpoint, you can't configure CloudFront to use HTTPS to communicate with your origin because Amazon S3 doesn't support HTTPS connections in that configuration.HTTPS between CloudFront and Amazon S3 is not supported when the S3 bucket is configured as a website endpoint.