Enhance1 Your AWS S3 Website with Subdomain, CDN, and AWS Certificate Manager

Enhancing Your AWS S3 Website with Subdomain, CDN, and AWS Certificate Manager

2 minutes, 28 seconds Read

Introduction: In our previous blog, we explored setting up a CI/CD pipeline with AWS CodeCommit and S3 hosting. Now, let’s take it a step further by enhancing our website with a subdomain, CDN (Content Delivery Network), and SSL (Secure Sockets Layer) encryption. These additions will improve performance, security, and accessibility for your web application.

Prerequisite:

  • An IAM user with required permissions.
  • Ensure your S3 bucket is configured for static website hosting.
  • Update bucket policy to allow public access and enable static website hosting.
  • Specify index and error documents for your website.

Step 1: Generate SSL Certificate with AWS Certificate Manager (ACM)

  • Navigate to the AWS Certificate Manager (ACM) service in the AWS Management Console.
  • Request a new SSL certificate for your subdomain (e.g., subdomain.yourdomain.com).
  • Follow the validation process to verify domain ownership.
  • Once validated, the SSL certificate will be issued and available for use.

    Note: Make sure to generate SSL Certificate in US-EAST-1 region only.

Step 2: Set Up Subdomain

  • Navigate to your DNS management console (e.g., GoDaddy).
  • Create a new CNAME record for your subdomain (e.g., subdomain.yourdomain.com) and point it to the S3 website endpoint URL of your production bucket.
HOSTTYPEVALUE
areyoua.examnative.comCnameareyoua-test.s3-website.ap-south-1.amazonaws.com
Example of CNAME Entries, and Make sure Prod bucket name should be same as the Domain Name.

Step 3: Enable CDN (Content Delivery Network) with Amazon CloudFront

  • Access the CloudFront service in the AWS Management Console.
  • Click “Create Distribution” and select “Web” distribution.
  • Specify your S3 bucket as the origin and configure other settings as needed.
  • Don’t Enable the WAF Firewall, it will increase your code and not required for this type of websites.
  • Associate the SSL certificate issued from ACM with the CloudFront distribution.
  • Save the distribution settings and wait for deployment.

Step 4: Test and Verify

  • Test your website using the subdomain URL to ensure proper functionality and SSL encryption.
  • Verify CDN caching and performance improvements by analyzing website load times from different geographic locations.

Step 5: Renew SSL Certificate

  • Monitor SSL certificate expiration dates and renew as needed through the AWS Certificate Manager console.

This post is a continuation of our previous blog. If you haven’t read the last blog, please check it out first using the link provided below:

Conclusion: By following these steps, you’ve successfully enhanced your AWS S3-hosted website with a subdomain, SSL encryption, and CDN. This strategic approach ensures a secure and optimized browsing experience for your visitors while prioritizing security through SSL certificate issuance before implementing CDN for enhanced performance. Stay ahead in the digital realm with an infrastructure optimized for security and efficiency!

Note: The process of generating SSL certificates from AWS Certificate Manager for a subdomain hosted on GoDaddy involves validating domain ownership and configuring DNS settings accordingly. Detailed instructions for this process can be found in the AWS Certificate Manager documentation and GoDaddy’s support resources.

author

Kartik Kocher

👋 Namaste! I'm Kartik Kocher, a Senior Cloud DevOps Engineer with over 8 years of experience in AWS cloud and DevOps. I'm passionate about delivering innovative cloud solutions, specializing in CI/CD pipelines, infrastructure automation, containerization, and cloud security. I've worked across various sectors, bringing efficiency through new products and services. Proficient in Jenkins, GitHub, AWS CodeBuild, and CodeDeploy for CI/CD pipelines, and adept at Kubernetes deployments on AWS EKS. Skilled in Terraform for infrastructure as code (IaC) practices. Security-focused with expertise in IAM roles, security groups, and compliance checks. Certified as an AWS Certified DevOps Engineer - Professional and AWS Certified Solutions Architect. I've led projects like migrating on-premises workloads to AWS and Azure, optimizing costs, and implementing CI/CD pipelines. Committed to following AWS best practices and contributing to the tech community through knowledge sharing and blogging. Reach out at me@kartikkocher.com or visit my website https://www.kartikkocher.com for collaboration or to connect. Tech enthusiast. Cloud explorer. Innovator. Let's connect and explore the endless possibilities in the cloud domain together! 🚀

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

X