Amazon Route 53 Routing Options

Simple Routing

  • Registered domain: mompopcafe.net, managed with Amazon Route 53.
  • VPC with two Amazon EC2 instances.
  • Each instance runs a web server hosting the mom pop cafe website.
  • Instances are configured identically.
  • Goal: Distribute HTTP requests evenly between the two EC2 instances in a round-robin fashion.

Configuration Steps

  1. Define a Route 53 record set in the mompopcafe.net hosted zone.
  2. Create public subnets in different availability zones.
  3. Run EC2 instances in different availability zones.
  4. Copy the public IP address of each instance.
  5. Configure the Route 53 record set with the IP addresses.

AWS Management Console Configuration

  • VPC: Public subnets one and two exist in different availability zones.

  • EC2: Two instances of the mom pop cafe server are running, each in a different subnet and availability zone.

  • Verification: Web app is running on both servers.

    • EU West 2A
  • Objective: Route traffic evenly between the two instances using the domain name.

Route 53 Service Dashboard

  • One registered domain and one hosted zone.
  • Domain mompopcafe.net is registered with Route 53.
  • Hosted zone created with the domain name.
  • Existing record sets: NS (name server) and SOA (start of authority).

Creating a New Record Set

  1. Click "Create Record Set".
  2. Name: www.mompopcafe.net.
  3. Type: A record (maps DNS name to one or more IP addresses).
  4. TTL (Time To Live): 15 seconds (short for demo purposes).
  5. Value: Paste the public IP addresses of the two running servers.
  6. Routing Policy: Simple (default).
  7. Save the record set.

Testing the Configuration

  1. Open a new browser tab and load the URL www.mompopcafe.net/mompopcafe.
  2. Verify that one of the two instances' page loads.
  3. Load the page multiple times to see traffic being routed between the two instances.

Explanation

  • Route 53 returns the two IP address values in random order to the recursive resolver.
  • The resolver returns the values to the web browser that submitted the DNS query.
  • HTTP requests to the domain name are routed between the two specified instances.

Failover Routing

  • Registered domain: mompopcafe.net managed with Amazon Route 53.
  • VPC with two subnets in different availability zones.
  • Each subnet has an EC2 instance running a web server hosting the mom and pop cafe website.
  • Instances are configured identically.
  • Goal: One instance (in availability Zone one) is the primary server. If it goes down, the instance in availability Zone two takes over.

Configuration

  • Define a Route 53 health check that monitors the status of the primary web server instance.
  • If the health check determines the primary instance is unreachable, traffic is routed to the secondary instance.
  • The Route 53 health check sends an alert to the administrator team.

AWS Management Console Setup

  • VPC: Public subnets one and two already exist.
  • EC2: Two instances of the mom pop cafe server are running in different subnets and availability zones.
  • Verification: Primary web server is working.

Route 53 Service Dashboard

  • One registered domain and one hosted zone.

Health Check Configuration

  1. Go to health checks and click create health check.

  2. Name: London website status.

  3. Monitor: Endpoint by IP address.

  4. Paste the public IP of the primary web server running in EUS two a.

  5. Port number: 80.

  6. Path: /mompopcafe (the URL that loads the web application).

  7. Advanced Configuration:

    • Request interval: 10 seconds (short for demo).
    • Failure threshold: 2 (number of health checks that need to fail).
  8. Create alarm: Define an SNS topic website down and enter email address.

  9. Click create health check.

Configuring Failover Routing

  1. Go to hosted zones and click on the registered domain.
  2. Click create record set.
  3. TTL: 15 seconds.
  4. Value: Public IP address from the primary server.
  5. Routing policy: Failover.
  6. Failover record type: Primary.
  7. Is this associated with a health check? Yes.
  8. Choose the health check defined earlier.
  9. Click create to save the record set.
  10. Define another record for the secondary web server.
  11. Give it the same name and 15 seconds for the TTL.
  12. For the value, copy the public IP of the web server.
  13. Routing policy: Failover, but this time the failover record type is secondary.
  14. The record set does not need a health check associated with it.
  15. Click Create.

Testing the Configuration

  1. Load the URL in a browser tab.
  2. The primary web server (EU West 2 A) should load.
  3. Simulate an issue with the web server by stopping the primary instance.
  4. Check the status of the Route 53 Health check.
  5. Verify that the health check status changes to unhealthy.
  6. Load the page again, and the secondary server should load.

Result

  • The website was only unresponsive for a few seconds.
  • Failover routing kicked in after 20 seconds (10-second interval * 2 failures).
  • HTTP requests are now routed to the secondary instance.

Final Step

  • Check email for the notification sent by the simple notification service.
  • Verify that the email informs about the web server failing the health check.

Geolocation Routing

  • Goal: Route users to specific resources based on their geographic location.
  • Users in Europe are routed to the website instance in the EU West 2 London region.
  • Users in North America are routed to the website instance in The US East 1 Virginia region.
  • Content localization: Currency in British pounds on the London website and in US dollars on the Virginia site.

AWS Management Console Configuration

  • EC2 management console in the London Data Center: Instance of the mom pop cafe server running.
  • Verification: Web server is working.
  • EC2 management console in the Virginia region: Instance of the mom pop cafe server running.
  • Verification: Web server is working.
  • Route 53 service dashboard: One registered domain and one hosted zone.

Creating New Record Sets

  1. Click create record set.
  2. Name: www.
  3. Type: A record.
  4. TTL: 15 seconds.
  5. Value: London web server's public IP address.
  6. Routing policy: Geo location.
  7. Location: Europe.
  8. Set ID: Europe London.
  9. Create the record set.
  10. Create another record set.
  11. Value: Virginia web server's public IP address.
  12. Routing policy: Geolocation.
  13. Location: North America.
  14. Set ID: North America-Virginia.
  15. Click Create.

Testing the Configuration

  1. Emulate different geographic locations using Windows instances.
  2. One instance in California and one in Paris.
  3. Establish a remote desktop connection to the California instance.
  4. Open a web browser and pull up the mompopcafe.net site.
  5. Verify that you are routed to the Virginia instance.
  6. Check the menu page to confirm the currency is in US dollars.
  7. Establish a remote desktop connection to the Paris, France instance.
  8. Open a web browser and pull up the mompopcafe.net site from there.
  9. Verify that you are routed to the London instance.
  10. Check the menu page to confirm the currency is in British pounds.