In this hands-on lab, we will assign a fully qualified domain name to an EC2 instance using Route 53. Our first step will be to create an EC2 instance and set it up as a web server. Then, we will create two record sets in a provided hosted zone in Route 53. Finally, we will verify that the domain name is working by using the domain name to serve the newly configured web server.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create an EC2 Instance
Create an EC2 instance, select the T2 micro free tier eligible instance type.
Make sure to enable Auto-assign Public IP.
Once the EC2 instance is up and running, copy the public IP address to use later.
For Windows users:
You can ssh into EC2 instances using PuTTY.
For details on how to use PuTTY to connect to an EC2 instance, see:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html
Another option is to use the Windows Subsystem for Linux:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
===
Connect to the EC2 instance using SSH, and run the following commands:
sudo yum update -y sudo yum install -y httpd sudo service httpd start sudo chkconfig httpd on
Open a new browser tab, and paste in the copied public IP address to verify our web server is up and running.
- Create Record Sets
First Record Set
- Navigate to Route 53 in the AWS console.
- Click Hosted zones.
- Select the listed zone.
- Update: The AWS Portal has changed. Choose "Create record"
- Choose "Simple routing"
- Choose "Define simple record"
- In "Value/Route traffic to" choose "IP address or another value depending on the record type"
- Enter the public IPv4 address of your EC2 instance.
- Click "Define simple record"
Second Record Set
- Choose "Define simple record" to create a 2nd record
- Put www in for the Record name
- In "Value/Route traffic to" choose "IP address or another value depending on the record type"
- Enter the public IPv4 address of your EC2 instance.
- Click "Define simple record"
- Choose "Create records"
- After a few minutes, open a new browser tab and paste in the domain names for both record sets we created. They should both result in the Linux Apache test page.