This guide explains how to connect Amazon S3, Route 53, CloudFront, and SSL to serve a secure website.
- AWS Account
- Domain Name (registered in Route 53 or elsewhere)
-
Static Website Files: Store your HTML, CSS, and JS files in an S3 bucket.
-
Custom Domain: Use Route 53 to create and manage DNS records for your domain.
-
SSL Certificate: Secure the website with HTTPS using AWS Certificate Manager (ACM).
-
Content Delivery: Distribute content globally and enforce HTTPS using CloudFront.
-
Diagram:
[Your Domain Name] <-----> [Route 53] | v [CloudFront (SSL)] | v [S3 Bucket (Static Website)]
-
Log in to the AWS Management Console.
-
Navigate to the S3 service.
-
Create a new S3 bucket:
- Bucket Name: Match your domain name (e.g.,
yourcreativecorner.xyz). - Region: Select a region close to your audience.
- Bucket Name: Match your domain name (e.g.,
- Enable Static Website Hosting:
- Go to the bucket properties.
- Select Static Website Hosting and enable it.
- Upload your website files (HTML, CSS, JS, etc.).
- Navigate to Route 53 in the AWS Console.
- Create a hosted zone:
- Click on "Create hosted zone."
- Enter your domain name and other required details.
-
Change the Nameservers:
- Copy the nameservers provided by Route 53.
- Update the nameservers with your domain registrar.
- Add a record set:
- Record Type:
A(Alias). - Alias Target: Set this to the CloudFront distribution (to be created later).
- Record Type:
- Navigate to Certificate Manager in the AWS Console.
- Request a public certificate:
- Add your domain name (e.g.,
yourcreativecorner.xyz).
- Validate the certificate via DNS:
- Add the CNAME records provided by ACM to your Route 53 hosted zone.
- Navigate to CloudFront in the AWS Console.
- Create a new distribution:
- Origin Domain Name: Select your S3 bucket.
- Viewer Protocol Policy: Redirect HTTP to HTTPS.
- Default Root Object:
index.html.
- Attach the SSL certificate:
- Deploy the distribution.
- Visit your domain in a browser.
- Ensure the site loads securely over HTTPS.
- S3 Bucket Permissions: Ensure the bucket policy allows public read access if needed.
- CloudFront Cache: Clear the cache after updates to S3.
- DNS Propagation: Allow up to 24 hours for DNS changes to take effect.
- Clear CloudFront cache:
aws cloudfront create-invalidation --distribution-id YOUR_DISTRIBUTION_ID --paths "/*" - Check DNS records:
nslookup example.com
























