Terraform v0.12.x
我正在尝试使用此脚本创建一个 Route53 记录,该脚本旨在创建一个别名为 ALB 的 A 记录。
data "aws_route53_zone" "mycompany_com" {
name = "mycompany.com."
private_zone = true
}
resource "aws_route53_record" "jenkins_master_green" {
zone_id = data.aws_route53_zone.mycompany_com.zone_id
name = "jenkins-green.${data.aws_route53_zone.mycompany_com.name}"
type = "A"
alias {
name = aws_lb.jenkins_master_green.dns_name
zone_id = data.aws_route53_zone.mycompany_com.zone_id
evaluate_target_health = false
}
}
该计划显示了我期望的正确值
$ terraform plan -out out.output
但是当我申请我得到的计划时
$ terraform apply out.output
aws_route53_record.jenkins_master_green: Creating...
Error: [ERR]: Error building changeset: InvalidChangeBatch: [Tried to create an alias that targets <redacted>.us-east-1.elb.amazonaws.com., type A in zone <redacted>, but the alias target name does not lie within the target zone, Tried to create an alias that targets <redacted>.us-east-1.elb.amazonaws.com., type A in zone <redacted>, but that target was not found]
status code: 400, request id: 2cf7384d-fa16-4828-854b-ea3e56cc0754
如果我转到 AWS Route53 控制台,我可以创建记录。我错过了什么?