In this hands-on lab you will learn how to create and manage DNS records inside of Route 53. You’ll start by creating a simple application. It will serve as a test website from two EC2 instances, and will route traffic using an Application Load Balancer ELB. After this, you will create two records inside a Route 53 hosted zone that will configure the DNS settings for a custom domain and point it to your application. Further, you’ll look at how DNS works in this scenario (and in general) and how a command line utility like `dig` can get more information about a domain. These skills will allow you to associate many kinds of AWS web applications with recognizable web domains such as *yourcoolsite.com*.
Successfully complete this lab by achieving the following learning objectives:
- Create Two EC2 Instances
- Navigate to the EC2 portion of the console.
- Press Launch Instances .
- Pick an Amazon Linux AMI.
- Select the T2 Micro free tier eligible instance type .
- On the Configure Instance step make sure that the Linux Academy VPC is selected.
- Make sure to select a different subnet for each of the two instances.
- Make sure to change Auto-assign Public IP address to Enable.
- Add a User Data Script under the advanced details section (see the description of this activity for the code you need).
- Press Next a few times until you get to the Confiure Security Group step.
- Create two instances:
- Create a new security group and add HTTP access to the security group.
- Make sure to select the security group you just created for the previous instance.
- Press Next and press the button to launch the instance (you will have to create a keypair to do this step).
- Repeat these steps again, but make sure to note the differences between the first and second instance’s creation process here.
- Create an Elastic Load Balancer
Create an Elastic Load Balancer in the AWS console:
- Navigate to the Load Balander section of the EC2 console.
- Press Create load balander.
- Select Application load balancer.
- Give the load balancer a name.
- Make sure to include the two Availability zones for this load balancer.
- Skip over the Configure Security Settings step.
- On the Configure Security Groups step create a new security group with the defaults.
- On the Configure Routing step make sure you select New target group and name your target group.
- Under Advanced health check settings set Healthy Threshold to 2.
- Wait a few minutes, then test out your new ELB from the DNS name provided under the ELB’s description in the EC2 console.
- Create Route 53 Record Sets
- Navigate to the Route 53 portion of the console.
- Enter the hosted zone for the custom domain you are provided.
- Press the Create Record Set button and select the A – IPv4 Address type.
- Make sure Alias is selected as Yes.
- Find your Elastic Load Balancer domain in the dropdown, select that and then press Create down at the bottom of the page.
- Repeat this process except make sure to enter www in the Name for one of the two records, so that you have an A record for the www subdomain too.