Skip to content

Commit

Permalink
Fix DNS record
Browse files Browse the repository at this point in the history
You can't make an ALIAS record for an EC2 node, since you get this
error:

│ Error: creating Route 53 Record: InvalidChangeBatch: [Tried to create an alias that targets ec2-3-120-245-80.eu-central-1.compute.amazonaws.com., type A in zone Z04499311AMTU66QF54HY, but the alias target name does not lie within the target zone]
  • Loading branch information
hellais committed Jul 2, 2024
1 parent 96378a5 commit 43d14e2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tf/modules/ansible_controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ resource "aws_instance" "ansible_controller" {
resource "aws_route53_record" "oonith_service_alias" {
zone_id = var.dns_zone_ooni_io
name = "ansible-controller"
type = "A"
type = "CNAME"
ttl = 300

alias {
name = aws_instance.ansible_controller.public_dns
zone_id = var.dns_zone_ooni_io
evaluate_target_health = true
}
records = [
aws_instance.ansible_controller.public_dns
]
}

0 comments on commit 43d14e2

Please sign in to comment.