【发布时间】:2021-08-12 08:48:11
【问题描述】:
我对编码和 terraform 非常陌生。
我试图将我需要的每个资源都写入 .tf 文件
在这样做的同时,我
Terraform plan
得到一个错误
│ Error: no matching Route53Zone found
│
│ with data.aws_route53_zone.<name>,
│ on <filename>.tf line 70, in data "aws_route53_zone" "<name>":
│ 70: data "aws_route53_zone" "<name>" {
这就是我写的
resource "aws_route53_zone" "example" {
name = "example.com"
comment = "eg-example"
tags= {
Name = "example.com"
}
}
resource "aws_acm_certificate" "eg-example-acm-domaincert" {
domain_name = "*.example.com"
validation_method = "DNS"
tags = {
name = "eg-example-acm-domaincert"
}
}
resource "aws_route53_record" "cname-example" {
zone_id = data.aws_route53_zone.example.zone_id
name = "cname.example.com"
type = "CNAME"
records = ["cname-example-alb-ext-1111111111.region.elb.amazonaws.com"]
ttl = "300"
}
data "aws_route53_zone" "example" {
name = "example.com."
private_zone = true
}
resource "aws_acm_certificate_validation" "eg-example-acm-domaincert" {
certificate_arn = "arn:aws:acm:**********************"
validation_record_fqdns = ["*****************************.example.com"]
}
代码与此差别不大。
除了在 AWS 控制台上创建一个区域之外,我真的没有任何想法。
还有其他方法吗?
希望我的解释对你有意义。
【问题讨论】:
标签: javascript amazon-web-services terraform amazon-route53