Complete the code to create a Route 53 record that points to an ELB.
resource "aws_route53_record" "example" { zone_id = aws_route53_zone.example.zone_id name = "www.example.com" type = "[1]" alias { name = aws_lb.example.dns_name zone_id = aws_lb.example.zone_id evaluate_target_health = true } }
When pointing a Route 53 record to an ELB using an alias, the record type must be A.
Complete the code to enable health check evaluation for the alias record.
resource "aws_route53_record" "example" { zone_id = aws_route53_zone.example.zone_id name = "app.example.com" type = "A" alias { name = aws_lb.app.dns_name zone_id = aws_lb.app.zone_id evaluate_target_health = [1] } }
The evaluate_target_health attribute must be set to the boolean true (without quotes) to enable health check evaluation.
Fix the error in the Route 53 record type for alias to ELB.
resource "aws_route53_record" "fix" { zone_id = aws_route53_zone.fix.zone_id name = "service.example.com" type = "[1]" alias { name = aws_lb.service.dns_name zone_id = aws_lb.service.zone_id evaluate_target_health = true } }
When creating an alias record to an ELB, the record type should be A, not CNAME. Alias records use type A for ELB targets.
Fill both blanks to create a Route 53 alias record pointing to an ELB with health check evaluation.
resource "aws_route53_record" "multi" { zone_id = aws_route53_zone.multi.zone_id name = "api.example.com" type = "[1]" alias { name = aws_lb.api.dns_name zone_id = aws_lb.api.zone_id evaluate_target_health = [2] } }
The record type for alias to ELB is A, and evaluate_target_health should be set to boolean true to enable health checks.
Fill all three blanks to create a Route 53 alias record with correct type, health check enabled, and zone ID from ELB.
resource "aws_route53_record" "full" { zone_id = aws_route53_zone.full.zone_id name = "web.example.com" type = "[1]" alias { name = aws_lb.web.dns_name zone_id = [2] evaluate_target_health = [3] } }
Alias record type must be A. The ELB's zone ID is referenced as aws_lb.web.zone_id. Health check evaluation is enabled by setting evaluate_target_health to true.