Terraform Route53 Error — Tried to create an alias, but the alias target name does not lie within the target zone

--

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

--

--

Rafael Medeiros
Rafael Medeiros

Written by Rafael Medeiros

DevOps Engineer | CNCF Kubestronaut | 3x Azure | Terraform Fanatic | Another IT Professional willing to help the community

No responses yet