<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrew Alba</title>
    <description>The latest articles on DEV Community by Andrew Alba (@andrewalba).</description>
    <link>https://dev.to/andrewalba</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F462985%2F0253632a-bf98-439a-82e9-7a08833f9ac6.jpg</url>
      <title>DEV Community: Andrew Alba</title>
      <link>https://dev.to/andrewalba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrewalba"/>
    <language>en</language>
    <item>
      <title>AWS Custom Domain Redirect with S3 and Route 53</title>
      <dc:creator>Andrew Alba</dc:creator>
      <pubDate>Fri, 18 Feb 2022 02:36:47 +0000</pubDate>
      <link>https://dev.to/andrewalba/aws-custom-domain-redirect-with-s3-and-route-53-59kl</link>
      <guid>https://dev.to/andrewalba/aws-custom-domain-redirect-with-s3-and-route-53-59kl</guid>
      <description>&lt;p&gt;Working with a client who has been using Zoom video conferencing frequently, I suggested a pretty URL to help clients access the  Zoom meetings.&lt;/p&gt;

&lt;p&gt;I decided that I wanted to create a URL that was something like &lt;code&gt;https://zoom.custom-domain.com/&lt;/code&gt; that would redirect to Zoom meeting link such as &lt;code&gt;https://us02web.zoom.us/j/94220614975?pwd=et9bd32Av2JC2yCtQifmA8ZoRpfxB6Nr&lt;/code&gt;. In the past, I would construct the redirect using &lt;code&gt;.htaccess&lt;/code&gt; or through the domain name registrar console. &lt;/p&gt;

&lt;p&gt;The client had a static site using a custom domain that was hosted on AWS using S3, CloudFront, and Route 53. I initially thought I could do this with the hosted zone for the client's domain name. I soon learned AWS has a different process for this type of redirect. Log into your AWS console and follow along.&lt;/p&gt;

&lt;h2&gt;
  
  
  S3 Bucket Redirect
&lt;/h2&gt;

&lt;p&gt;To create the redirect, we need to start by creating an S3 Bucket. It didn't make much sense to me at first, but we will connect the dots later. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the S3 service in your console.&lt;/li&gt;
&lt;li&gt;We used the domain URL to name our bucket &lt;em&gt;zoom.custom-domain.com&lt;/em&gt;. Be sure to uncheck the &lt;strong&gt;Block &lt;em&gt;all&lt;/em&gt; public access&lt;/strong&gt; under &lt;strong&gt;Block Public Access settings for this bucket&lt;/strong&gt; section. You will need to check the box that appears to acknowledge this change.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Create bucket&lt;/strong&gt; button.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YksPK3u7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vv7h6cati9e2ydvq4f2c.png" alt="Create S3 Bucket" width="880" height="1211"&gt;
&lt;/li&gt;
&lt;li&gt;Click the bucket name in the list of buckets to open the bucket.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Properties&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Scroll to the bottom of the page and click the &lt;strong&gt;Edit&lt;/strong&gt; button within the &lt;strong&gt;Static website hosting&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Select the &lt;em&gt;Enable&lt;/em&gt; radio button under &lt;strong&gt;Static website hosting&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;em&gt;Redirect requests for an object&lt;/em&gt; radio button under &lt;strong&gt;Hosting type&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter the redirect URL within the &lt;strong&gt;Host name&lt;/strong&gt; field.&lt;/li&gt;
&lt;li&gt;Select your Protocol.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Save changes&lt;/strong&gt; button to complete.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hPHDcxcT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xe3sspkh4bxzqrpbze7z.png" alt="Edit Static Hosting" width="880" height="705"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Our redirect is now in place and you can test by scrolling back down to the &lt;strong&gt;Static website hosting&lt;/strong&gt; section and using the redirect link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mCAWDXPJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0zhtfj4kh3dv45ubgw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mCAWDXPJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0zhtfj4kh3dv45ubgw4.png" alt="Verify Redirection Link" width="880" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Redirect to Route 53
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Navigate your browser to Route 53 service and click on the &lt;strong&gt;Hosted zones&lt;/strong&gt; link to list the hosted zones.&lt;/li&gt;
&lt;li&gt;Select/click the hosted zone we would like to add a record too.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Records&lt;/strong&gt; section click the &lt;strong&gt;Create record&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Toggle the &lt;em&gt;Alias&lt;/em&gt; on.&lt;/li&gt;
&lt;li&gt;Enter your subdomain value in the &lt;strong&gt;record name&lt;/strong&gt; field. In our example it is &lt;em&gt;zoom&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Route traffic to&lt;/strong&gt; option, select &lt;strong&gt;Alias to S3 website endpoint&lt;/strong&gt;. Select your region and then select the S3 bucket redirect created above.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Create records&lt;/strong&gt; button.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uclXd03P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9igcv2v186m7q7cqsdh.png" alt="Create Hosting Record" width="880" height="413"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the host record propagates, the URL should redirect. Test it out in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This wasn't the solution I expected when I started on this path, but the implementation is simple. Hopefully, you found these instructions useful. If you have any comments, feel free to share them.&lt;/p&gt;

&lt;p&gt;Best of luck and cheers!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>aws</category>
      <category>s3</category>
      <category>route53</category>
    </item>
    <item>
      <title>Deploying a Secure Static Site to AWS with S3, Route 53 and CloudFront</title>
      <dc:creator>Andrew Alba</dc:creator>
      <pubDate>Sat, 12 Feb 2022 22:26:00 +0000</pubDate>
      <link>https://dev.to/andrewalba/deploying-a-secure-static-site-to-aws-with-s3-route-53-and-cloudfront-3d0b</link>
      <guid>https://dev.to/andrewalba/deploying-a-secure-static-site-to-aws-with-s3-route-53-and-cloudfront-3d0b</guid>
      <description>&lt;p&gt;There probably hasn't been a better time to host static websites than today. As a developer, you can use some excellent free services such as &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;, &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, and &lt;a href="https://firebase.google.com/" rel="noopener noreferrer"&gt;Firebase&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Hosting a static site in the cloud with companies such as &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;, &lt;a href="https://www.heroku.com/" rel="noopener noreferrer"&gt;Heroku&lt;/a&gt;, and &lt;a href="https://www.digitalocean.com/" rel="noopener noreferrer"&gt;DigitalOcean&lt;/a&gt; can be done at a low cost as well.&lt;/p&gt;

&lt;p&gt;Being most familiar with AWS, this is the route I have chosen for a client. These instructions will likely be outdated within a year but should offer some guidance for anyone trying to create a static site that takes advantage of the features and services provided by AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS
&lt;/h2&gt;

&lt;p&gt;There are several economic reasons for using AWS to host a static site. AWS provides developers with a free tier for many of their services. Bandwidth and storage costs are low because of the large scale of AWS. AWS can help us manage our custom domain with certificate management, hosted zones, and a content delivery network.&lt;/p&gt;

&lt;p&gt;My intention is to provide guidance through this process of setting up and hosting an HTTPS-enabled static website using AWS services with a custom domain. I use &lt;a href="https://www.namecheap.com/" rel="noopener noreferrer"&gt;Namecheap&lt;/a&gt; for domain name registrations, but these instructions can be applied with other registrar services.&lt;/p&gt;

&lt;p&gt;There are a few assumptions that will be made for this guide. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You have an AWS account or can create an account before starting the guide.&lt;/li&gt;
&lt;li&gt;You have a custom domain registered and access to modify nameserver.&lt;/li&gt;
&lt;li&gt;You have about thirty minutes to complete this guide.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here are the four services we will be using with our static website project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://console.aws.amazon.com/acm/" rel="noopener noreferrer"&gt;AWS Certificate Manager&lt;/a&gt; or ACM. We can generate an SSL certificate for our custom domain name with this service and set up HTTPS for our site.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://s3.console.aws.amazon.com/s3/" rel="noopener noreferrer"&gt;Simple Storage Service&lt;/a&gt; or S3. As the name suggests, we can upload our static content to a &lt;strong&gt;bucket&lt;/strong&gt;, and serve the files to website visitors.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://console.aws.amazon.com/cloudfront/v3/" rel="noopener noreferrer"&gt;CloudFront&lt;/a&gt;. This is the AWS content delivery network. The service distributes static content to nodes around the globe. This service improves the user experience for worldwide traffic. CloudFront will add a small cost to our hosting fees but provide free SSL termination for HTTPS.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://console.aws.amazon.com/route53/v2/" rel="noopener noreferrer"&gt;Route 53&lt;/a&gt; is the service to manage our DNS records. This service integrates our custom domain from NameCheap to our CloudFront distribution.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Route Traffic From Our Custom Domain to Route53
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log into your AWS account and open the Route 53 dashboard. In the left navigation, select the &lt;strong&gt;Hosted Zone&lt;/strong&gt; link. Once the &lt;strong&gt;Hosted Zone&lt;/strong&gt; page loads, find and click the &lt;strong&gt;Create hosted zone&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Add your Domain name and a description of the hosted zone record. Leave the default type &lt;strong&gt;Public hosted zone&lt;/strong&gt; selected. Add any tags you would like and click the &lt;strong&gt;Create hosted zone&lt;/strong&gt; button.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgyc6hq5derv3kjrtap6.png" alt="Create hosted zone"&gt;
&lt;/li&gt;
&lt;li&gt;Once your hosted zone is created, select the hosted zone and click the &lt;strong&gt;View details&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Expand the &lt;strong&gt;Hosted zone details&lt;/strong&gt; and take note of the name server records. We will need to use these for our custom domain.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmduii00vlvhv0431slm.png" alt="View hosted zone"&gt;
&lt;/li&gt;
&lt;li&gt;Open a new browser tab and use that to log into your custom domain registrar. Navigate to manage the domain nameservers. For Namecheap navigate to a list of our domains and then click the &lt;strong&gt;Manage&lt;/strong&gt; button. Scroll down to the name server section and change the selected name server from &lt;em&gt;Namecheap BasicDNS&lt;/em&gt; to &lt;em&gt;Custom DNS&lt;/em&gt;. Under the selection, you can now enter the name server records from step 4. Depending on the registrar, the propagation time of these changes can vary. In my experience, the propagation only takes a few minutes, but it can be several hours for some.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkyy72qy4ecnglghrjwk1.png" alt="Custom domain name server"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Generating an SSL certificate
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open a new browser tab and navigate to the ACM service. Click on the &lt;strong&gt;Request a certificate&lt;/strong&gt; button. If viewing the certificate list, click on the &lt;strong&gt;Request&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Under &lt;em&gt;Certificate Type&lt;/em&gt;, verify the default &lt;strong&gt;Request a public certificate&lt;/strong&gt; is selected and click the &lt;strong&gt;Next&lt;/strong&gt; button.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfhpd7uk1xiwdubi48og.png" alt="Request certificate"&gt;
&lt;/li&gt;
&lt;li&gt;Add all fully qualified names you plan to use in the Domain section. Keep the default selected DNS validation under the Select validation method. Add any tags (optional) and then click the &lt;strong&gt;Request&lt;/strong&gt; button. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl9nhdxmmmawmgicwbeh.png" alt="Request public certificate"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Generation of the certificates will take some time. Once the certificate generates, click on the Certificate ID link to view the certificate. Scroll to the Domains section and take note of the CNAME records. These records will need to be added to the Route 53 hosted zone. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwq587cf3uloi7ytks7m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwq587cf3uloi7ytks7m1.png" alt="Certificate domain record"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect Certificates to Hosted Zone
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the Route 53 hosted zone tab and click on the domain name link to access the records. Scroll down to the &lt;strong&gt;Records&lt;/strong&gt; section and click on the &lt;strong&gt;Create record&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;If there is a subdomain record, add that prefix to the &lt;em&gt;Record name&lt;/em&gt;. If this is the root domain, leave the field empty. Change &lt;em&gt;Record Type&lt;/em&gt; to CNAME. Paste the &lt;em&gt;CNAME value&lt;/em&gt; from the certificate record into the Value field. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lz4dshixomvwidmb1jr.png" alt="Create zone record"&gt;
&lt;/li&gt;
&lt;li&gt;If you have more than one record, click the &lt;strong&gt;Add another record&lt;/strong&gt; button and repeat the step 2 instructions for each record. Once completed, click the &lt;strong&gt;Create records&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Note: We will need to confirm that the certificate has been associated with the hosted records later.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an S3 bucket for Static Hosting
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to AWS S3 and click on the &lt;strong&gt;Create bucket&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;S3 buckets are global, so you will need to use a unique bucket name. Use your domain name as your &lt;em&gt;Bucket Name&lt;/em&gt;. Scroll down and uncheck the &lt;strong&gt;Block &lt;em&gt;all&lt;/em&gt; public access&lt;/strong&gt; box under the &lt;strong&gt;Block Public Access settings for this bucket&lt;/strong&gt; section. Scroll to the bottom and select the &lt;strong&gt;Create bucket&lt;/strong&gt; button.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfi8c8009ywah8r3uqcc.jpg" alt="S3 bucket create"&gt;
&lt;/li&gt;
&lt;li&gt;After the bucket has been created, navigate to the &lt;strong&gt;Permissions&lt;/strong&gt; tab of the bucket and scroll down to the &lt;strong&gt;Bucket policy&lt;/strong&gt; section. Click the Edit button and create a bucket policy to allow public read access to the bucket.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "MySiteGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::example.com/*"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Within the bucket select the &lt;strong&gt;Properties&lt;/strong&gt; tab. Scroll down to the &lt;strong&gt;Static web hosting&lt;/strong&gt; section (at the bottom of the page) and click the &lt;strong&gt;Edit&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;Enable&lt;/em&gt; under &lt;strong&gt;Static website hosting&lt;/strong&gt; and &lt;em&gt;Host a static website&lt;/em&gt; under &lt;strong&gt;Hosting type&lt;/strong&gt;. Add the static sites Index document (index.html for most) and then click the &lt;strong&gt;Save changes&lt;/strong&gt; button. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjctqdtp4wc523ni5tyog.png" alt="S3 edit static website"&gt;
&lt;/li&gt;
&lt;li&gt;After saving, we should have a URL for the static website provided by S3 (example: &lt;a href="http://example.com.s3-website-us-east-1.amazonaws.com" rel="noopener noreferrer"&gt;http://example.com.s3-website-us-east-1.amazonaws.com&lt;/a&gt;). Take note or copy this URL as we will need this to create our CloudFront distribution. &lt;/li&gt;
&lt;li&gt;Upload all of your static website files to the S3 bucket. You should be able to verify your site using the link provided in step 5.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Create CloudFront Distribution
&lt;/h2&gt;

&lt;p&gt;Before we start this process, we will want to make sure our SSL certificate has been successfully connected to the hosted zone. Navigate back to the ACM and wait/refresh until the Status shows success. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqr50ut4vk23lcpngyyz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqr50ut4vk23lcpngyyz.png" alt="Issued status"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the CloudFront dashboard and click the &lt;strong&gt;Create Distribution&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;In the Origin domain field paste in the S3 static website URL from step 5 of creating an S3 bucket. The Name section should populate with the bucket name (example: example.s3-website-us-east-1.amazonaws.com).&lt;/li&gt;
&lt;li&gt;Scroll down to &lt;strong&gt;Default cache behavior&lt;/strong&gt; section and select &lt;em&gt;Redirect HTTP to HTTPS&lt;/em&gt; under &lt;strong&gt;Viewer protocol policy&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Scroll to Settings and be sure to select the price class that is best for your website. If your static hosted site is intended for use in the US only, select &lt;em&gt;Use only North America and Europe&lt;/em&gt; for example.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Add item&lt;/strong&gt; button under the &lt;em&gt;Alternate domain name (CNAME)&lt;/em&gt; heading and add each one of your domains. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3ky1doq5mmj2r5xzp32.png" alt="CloudFront settings"&gt;
&lt;/li&gt;
&lt;li&gt;Within the selector for &lt;strong&gt;Custom SSL certificate&lt;/strong&gt;, choose the SSL certificate for our custom domain.&lt;/li&gt;
&lt;li&gt;Scroll to the bottom and click the &lt;strong&gt;Create distribution&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The CloudFront distribution will take several minutes to generate. Once the distribution is completed, you should be able to access your website using the secure custom domain.&lt;/p&gt;

&lt;p&gt;After making updates to your site and uploading the changes to your S3 bucket, you will want to look at creating an invalidation with the CloudFront distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Pro Tips for AWS
&lt;/h2&gt;

&lt;p&gt;Within your AWS account, make sure you view your billing dashboard. Within the billing dashboard, you can create a budget. Be sure to use this and create a budget that is acceptable for your use. This can save you from spending more money than you expect in a monthly billing period.&lt;/p&gt;

&lt;p&gt;Within CloudWatch, set up a billing alarm for your AWS spending. This can alert you of any unexpected services that you may have left running.&lt;/p&gt;

&lt;p&gt;Take advantage of AWS SDK written in your preferred development language for automating deployments and creating invalidations for your CloudFront distributions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While the tutorial was not as detailed as I initially intended, it is my hope that the tutorial is enough to make your static website public to users. Please take some time to implement the pro tips above and spend some time learning more about the four AWS services we have discussed.&lt;/p&gt;

&lt;p&gt;If you have found this tutorial useful and would like to connect, follow me on &lt;a href="https://twitter.com/albawebstudio" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Best of luck and cheers!&lt;/p&gt;

&lt;p&gt;Cover image by &lt;a href="https://unsplash.com/@casparrubin?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Caspar Camille Rubin&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
