Terraform Route53 Error — Tried to create an alias, but the alias target name does not lie within the target zone
Sep 9, 2024
This is a quick post to show how to fix the following error
When you are setting the zone_id for an alias, it is not the DNS zone ID that you should use, instead, you should get the Hosted Zone ID of Elastic Load Balancing here:
Get the load balancer zoneID corresponding to your region:
Add to your terraform code, and run apply again:
That’s it, hope it helps!
Follow me on: Linkedin