We will create Route 53 Routing policies base on latency.

Where there is no red arrow or description, leave the default value.

First we need to create two web servers with sample web code in to different region.

To do this exercise, we need running to servers

Screenshot.png


Use sample user data code to create it.

Copy code and run as user data when launch servers

Screenshot.png


Copy and past code

To use this code you have to use AWS Amazon Linux ISO!


#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
INTERFACE=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/)
SUBNETID=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${INTERFACE}/subnet-id)
echo '<center><h1>This instance is in the subnet wih ID: SUBNETID </h1></center>' > /var/www/html/index.txt
sed "s/SUBNETID/$SUBNETID/" /var/www/html/index.txt > /var/www/html/index.html

And which one will show the instance location.

Screenshot.png


Go to Route 53, hosted zone.

Screenshot.png


At this point you have to have domain

We need a registered domain to use

Screenshot.png


Create record

the record must be A record

Screenshot.png


it hast to be A record

Screenshot.png


Routing policy overview, and create record

Screenshot.png


Create second record for another web

We do exactly the same steps as with first record

Screenshot.png


Check if it is working

Check if it is working use web browser and proxy servers

Screenshot.png


you can enable health check

optional you can enable health check

Screenshot.png


Clean up your A records

Clean up yours records

Screenshot.png