text Terraform:ACM与DNS验证
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Terraform:ACM与DNS验证相关的知识,希望对你有一定的参考价值。
# ------------------------------------------------------------
# Discover Zone Information for DNS Domain
# ------------------------------------------------------------
data "aws_route53_zone" "public" {
name = "${var.app_dns_domain}"
}
# ------------------------------------------------------------
# ACM Certificate Creation
# ------------------------------------------------------------
resource "aws_acm_certificate" "application" {
domain_name = "${var.app_dns_name}"
validation_method = "DNS"
subject_alternative_names = [
"*.${var.app_dns_name}"
]
tags {
Name = "${var.app_dns_name}"
Owner = "${var.tag_owner}"
Subsystem = "${var.tag_subsystem}"
Environment = "${var.environment}"
}
lifecycle {
create_before_destroy = true
}
}
# ------------------------------------------------------------
# ACM Validation Records
# ------------------------------------------------------------
resource "aws_route53_record" "acm_validation" {
count = "${length(aws_acm_certificate.application)}"
zone_id = "${data.aws_route53_record.public.zone_id}"
name = "${aws_acm_certificate.application.domain_validation_options.*.resource_record_name[count.index]}"
type = "${aws_acm_certificate.application.domain_validation_options.*.resource_record_type[count.index]}"
records = ["${aws_acm_certificate.application.domain_validation_options.*.resource_record_value[count.index]}"]
ttl = 60
}
以上是关于text Terraform:ACM与DNS验证的主要内容,如果未能解决你的问题,请参考以下文章
使用新记录验证证书
如何 Terraform 创建和验证 AWS 证书
AWS ACM 证书未验证
terraform - 如何为 DNS 创建 Route53?
使用 Terraform 创建多个 DNS Route53 A 记录
AWS证书管理器DNS验证方法不适用于API