Setting Up Your CloudFront Distribution Network (CDN)

In this lesson, we’ll set up your CloudFront Distribution Network, also known as a CDN. Let’s get started.

Step 1: Navigate to CloudFront

  • Go to CloudFront in your AWS console. 
  • Click Create Distribution.

Step 2: Configure Your Domain Name

  • Type or paste your domain name (without any prefixes) into the domain name field.
  • When it appears in the dropdown, click on it.
  • In the Endpoint dialog box, click Use website endpoint.

Step 3: Configure Viewer Settings

  • Scroll down to the Viewer section and select Redirect HTTP to HTTPS.

Step 4: Web Application Firewall (WAF)

  • Scroll down to Web Application Firewall and select Do not enable security protections.

Step 5: Alternate Domain Names (CNAME)

  • Continue to the Settings section and locate the Alternate Domain Name (CNAME) field.
  • Enter your domain name (e.g., example.com).
  • Click Add Item, and re-enter your domain with www (e.g., www.example.com).

Step 6: Attach Your SSL Certificate

  • Scroll down to Custom SSL.
  • Click the field, locate the SSL certificate you created earlier, and select it.

Step 7: Avoid Legacy Support

  • Make sure you DO NOT SELECT Legacy Support.
  • Note: This costs $600 per month and is not needed.

Step 8: Default Root Object

  • Enter index.html as your Default Root Object.
  • Click Create Distribution.

Step 9: Save Your Distribution Domain Name

  • After your distribution is created, you’ll be redirected to the General tab.
  • Copy your Distribution Domain Name and paste it into your Google Doc where your other records are stored.

Step 10: Create Custom Error Response

  • Back in CloudFront, navigate to the Error Pages tab.
  • Click Create Custom Error Response.
  • Do not select 404 Not Found. Instead, select 403 Forbidden.
  • Change Error Response to Yes.
  • Enter the path to your error page as /error.html (make sure to include the slash).
  • Select 403 Forbidden as the HTTP Error Code.
  • Click Create Custom Error Response.

You have now successfully created your CloudFront Distribution. This concludes this lesson.

In the next lesson, we’ll add two more CNAME records to your domain. Please proceed to that lesson.

Resources