<?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: Avana Wallet</title>
    <description>The latest articles on DEV Community by Avana Wallet (@avana-wallet).</description>
    <link>https://dev.to/avana-wallet</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%2Forganization%2Fprofile_image%2F5622%2F495d3de4-2b18-4f3e-9d4e-d9dfa82a67d2.png</url>
      <title>DEV Community: Avana Wallet</title>
      <link>https://dev.to/avana-wallet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/avana-wallet"/>
    <language>en</language>
    <item>
      <title>How to configure DNS records for a Next.js Vercel app using AWS Route53</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Wed, 11 May 2022 22:49:16 +0000</pubDate>
      <link>https://dev.to/avana-wallet/how-to-configure-dns-records-for-a-nextjs-vercel-app-using-aws-route53-441k</link>
      <guid>https://dev.to/avana-wallet/how-to-configure-dns-records-for-a-nextjs-vercel-app-using-aws-route53-441k</guid>
      <description>&lt;p&gt;Configuring the proper settings in AWS Route53 can sometimes be a bit time-consuming for something that really should be simple. We recently configured our AWS Route53 hosted zone to point to our Next.js app at Vercel. The process involves several not-so-intuitive steps, so we figured that writing a basic guide might help others in the community facing a similar challenge.&lt;/p&gt;

&lt;p&gt;Vercel is amazing, but we ran into a snag when we saw the screen below. Remedying this situation takes a few extra steps laid out below. AWS does not allow apex records (root domain) to point to Vercel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YkcRAX0O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i23s53gep13h1deeo9ij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YkcRAX0O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i23s53gep13h1deeo9ij.png" alt="Image description" width="752" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our configuration instructions below walks you through how you can route all www and non-www traffic for both http/https to a Vercel app.&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Add Vercel domain&lt;/strong&gt;. Add your domain to Vercel (Project Settings =&amp;gt; Domains)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YTA1kNL5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y67hcqn9ffs72v2pu9mu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YTA1kNL5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y67hcqn9ffs72v2pu9mu.png" alt="Image description" width="788" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create an S3 bucket&lt;/strong&gt;. Next we need to create an S3 bucket in AWS that matches your domain. For example, we created avanawallet.com. It is important that it matches your domain name exactly.&lt;/p&gt;

&lt;p&gt;After you create your bucket, go to Properties =&amp;gt; Static website hosting and change the following settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static website hosting = enabled&lt;/li&gt;
&lt;li&gt;Hosting type = Redirect requests for an object&lt;/li&gt;
&lt;li&gt;Host name = your website, for instance, we used &lt;a href="http://www.avanawallet.com"&gt;www.avanawallet.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Protocol = https&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eyziqLAu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcox8g8st6wtvycy8i5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eyziqLAu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcox8g8st6wtvycy8i5n.png" alt="Image description" width="619" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've setup your bucket you will see a link for the bucket website. Take note and save this link - you will need it later.&lt;/p&gt;

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

&lt;p&gt;Now if you follow that link, it will redirect you to the host name you entered. In theory you could point a CNAME record to this link and all would be good... except we need to also handle https requests. So let's go ahead and figure that out in Steps 3 and 4.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create SSL Certificate&lt;/strong&gt;. Create your SSL/TLS certificate in AWS Certificate Manager. For the domain configuration, we suggest adding two settings similar to below. This setting will cover all subdomains (including www).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avanawallet.com&lt;/li&gt;
&lt;li&gt;*.avanawallet.com &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create Cloudfront Distribution&lt;/strong&gt;. Next we need to create a Cloudfront distribution so we can add our certificate created in Step 3.&lt;/p&gt;

&lt;p&gt;Create a distribution with the following settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Origin domain: Use the URL from Step 2. It's important that you use this URL, and not the pre-populated one from S3 that Cloudfront generates.&lt;/li&gt;
&lt;li&gt;Viewer protocol policy: Redirect HTTP to HTTPS (or "HTTP and HTTPS" if you prefer)&lt;/li&gt;
&lt;li&gt;Price class: We recommend "Use all edge locations (best performance)", but any option will work. Latency times increase with other options.&lt;/li&gt;
&lt;li&gt;Alternate domain name (CNAME): add your domain name. For instance, we added avanawallet.com&lt;/li&gt;
&lt;li&gt;Custom SSL certificate: Choose the certificate you created in Step 3&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---3FhAbmb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54lmn4k6shvd05n33fed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---3FhAbmb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54lmn4k6shvd05n33fed.png" alt="Image description" width="880" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, now we should have a working Cloudfront distribution. Let's move on to the DNS records, the final step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Configure Route53&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Now we need to add two A Records. First, let's add the A Record for &lt;a href="http://www"&gt;www&lt;/a&gt;. Create an "A Record" for &lt;a href="http://www.avanawallet.com"&gt;www.avanawallet.com&lt;/a&gt; and point that to 76.76.21.21 (Vercel, confirm IP is still the same just to be safe before you point there).  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q3pbybLa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/og1icvlictqevgt0o8rf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q3pbybLa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/og1icvlictqevgt0o8rf.png" alt="Image description" width="391" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to create an A Record for the apex - point that to the Cloudfront distribution we created in Step 4. Choose "Alias =&amp;gt; Cloudfront =&amp;gt; [your region] =&amp;gt; [distribution]"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2NxddAw3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aflgs727byalmwikr6yy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2NxddAw3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aflgs727byalmwikr6yy.png" alt="Image description" width="386" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, we should be all setup now. Test your setting. I recommend testing all four combinations to make sure they work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://avanawallet.com"&gt;http://avanawallet.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://avanawallet.com"&gt;https://avanawallet.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.avanawallet.com"&gt;http://www.avanawallet.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.avanawallet.com"&gt;https://www.avanawallet.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All should route you to &lt;a href="https://www.avanawallet.com"&gt;https://www.avanawallet.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope this brief guide helps!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
