Day06_Amazon Route 53 - harishgorla5/HINTechnologies-aws-services GitHub Wiki
Amazon Route 53 β
π Part 1: Introduction to Amazon Route 53
What is Route 53?
Amazon Route 53 is a scalable and highly available Domain Name System (DNS) web service.
Why "Route 53"?
- Named after port 53, the port used for DNS queries.
Key Features:
- Domain registration
- DNS routing
- Health checking & failover
Use Cases:
- Map domain names to AWS services (EC2, S3, ELB, CloudFront)
- Implement high availability and load balancing
- Hybrid cloud DNS resolution
π Part 2: Core Concepts
1. Domain Name System (DNS)
- Translates domain names (like
example.com
) to IP addresses
2. Hosted Zone
- A container for records related to a domain (like a DNS zone file)
- Two types:
- Public Hosted Zone: For internet-facing domains
- Private Hosted Zone: For internal AWS resources (VPC)
3. Record Sets (DNS Records)
- Types:
- A Record: Maps domain to an IPv4 address
- AAAA Record: Maps domain to an IPv6 address
- CNAME: Alias to another domain name
- MX: Mail exchange
- NS: Name servers for the domain
- SOA: Start of authority
- TXT: Text records (e.g., verification)
- Alias: AWS-specific (e.g., S3, ELB)
π Part 3: Routing Policies
Routing Policy | Use Case | Description |
---|---|---|
Simple | Single resource | Basic IP or Alias mapping |
Weighted | A/B Testing or load balancing | Assign weights to resources |
Latency | Geo latency-based optimization | Direct to region with lowest latency |
Failover | High availability setups | Primary/secondary failover based on health check |
Geolocation | Region-specific content | Route based on userβs geographic location |
Geoproximity (Traffic Flow) | Advanced regional routing | Bias traffic toward regions (requires Traffic Flow) |
Multi-value answer | Basic round-robin | Returns multiple healthy IPs |
π οΈ Part 4: Hands-On Lab β Host a Website Using Route 53
Objective:
Host a static website in S3 and use Route 53 to point your domain to it.
Prerequisites:
- Registered domain (can be via Route 53 or external provider)
- S3 bucket with static website
Steps:
1. Create an S3 Bucket (static website)
- Bucket name must match your domain (e.g.,
mydomain.com
) - Enable Static website hosting
- Upload
index.html
2. Create a Hosted Zone
- Go to Route 53 > Hosted Zones > Create Hosted Zone
- Type: Public Hosted Zone
- Domain:
mydomain.com
3. Create an Alias Record
- Go to Record sets > Create Record
- Name: (leave blank for root domain)
- Type: A β IPv4 address
- Alias: Yes β Choose S3 endpoint from drop-down
4. Update Name Servers at Registrar
- If domain is external:
- Copy NS records from Route 53
- Update them at domain registrar
5. Access Website
- Navigate to
http://mydomain.com
πΌ Part 5: Real-Time Use Case β Regional Web Failover
Objective:
Serve traffic from primary EC2 in us-east-1
, and failover to EC2 in us-west-2
during outage.
Steps:
1. Setup Two EC2 Instances
- One in
us-east-1
and one inus-west-2
- Install web server and custom index page (e.g., "Primary" vs "Backup")
2. Create Two A Records
- Use Failover routing policy
- Set up health check on primary EC2 (TCP or HTTP)
3. Test
- Stop primary EC2 or fail health check
- Route 53 automatically routes to secondary
π Part 6: Pricing & Limits
Pricing:
- Hosted zone: $0.50/month per zone
- Queries: $0.40/million for first 1B queries
- Health checks: ~$0.50/month
Limits:
- 500 domain names per AWS account (can increase)
- 10,000 records per hosted zone (soft limit)
π§ Part 7: Tips & Best Practices
- Use Alias Records for AWS resources (no extra cost)
- Monitor DNS with CloudWatch metrics
- Use TTLs appropriately (shorter for failover scenarios)
- Use private hosted zones for internal-only DNS (e.g., VPC service discovery)
- Document all health checks and failover policies
β Part 8: Q&A and Wrap-up
- Discuss custom routing scenarios
- Real-world examples from participants
- Link Route 53 with CloudFront, S3, or EC2 for full stack hosting
End of Session