-
Notifications
You must be signed in to change notification settings - Fork 1
/
acm.tf
32 lines (26 loc) · 1.2 KB
/
acm.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#--------------------------------------------------------------------------------
# Set up ACM certificate for our ALB / ELB
#--------------------------------------------------------------------------------
resource aws_acm_certificate public_cert {
domain_name = "${substr(local.dns_master, 0, length(local.dns_master) - 1)}"
subject_alternative_names = [
"${local.acm_san}",
]
validation_method = "DNS"
tags {
Name = "Openshift certificate ${var.environment}"
Environment = "${var.environment}"
Terraform = "true"
}
}
# Validate the cert
resource aws_route53_record public_cert_validation {
count = "${1 + length(local.acm_san)}" # the 1 + is for the main domain
name = "${lookup(aws_acm_certificate.public_cert.domain_validation_options[count.index], "resource_record_name")}"
type = "${lookup(aws_acm_certificate.public_cert.domain_validation_options[count.index], "resource_record_type")}"
zone_id = "${data.aws_route53_zone.selected.zone_id}"
records = [
"${lookup(aws_acm_certificate.public_cert.domain_validation_options[count.index], "resource_record_value")}",
]
ttl = 60
}