Closed jonathancolby-olx closed 5 years ago
Hi @jonathancolby-olx 👋Sorry you ran into trouble here.
Looking at your configuration above, it appears the aws_route53_record
alias name
and zone_id
arguments are swapped:
name = "${lookup(aws_vpc_endpoint.my_service_endpoint.dns_entry[0], "hosted_zone_id")}"
zone_id = "${lookup(aws_vpc_endpoint.my_service_endpoint.dns_entry[0], "dns_name")}"
Switching them so they align should correct the error you're seeing:
name = "${lookup(aws_vpc_endpoint.my_service_endpoint.dns_entry[0], "dns_name")}"
zone_id = "${lookup(aws_vpc_endpoint.my_service_endpoint.dns_entry[0], "hosted_zone_id")}"
That said, the Terraform resource here could provide a slightly better message here before calling the Route53 API if we implemented length validation for both of those attributes. For example:
Error applying: 1 error occurred:
* aws_route53_record.test: expected length of alias.0.zone_id to be in the range (1 - 32), got vpce-0ed0dbc5b2e181289-kr42z80r.vpce-svc-04a7ad6c6da00d525.us-west-2.vpce.amazonaws.com
I have submitted the above validation as a pull request: #7606
Hope this helps!
Validation has been merged and will release with version 1.60.0 of the Terraform AWS Provider, likely later today.
This has been released in version 1.60.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Actual Behavior