forked from zigbee-alliance/distributed-compliance-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacm.tf
25 lines (19 loc) · 1.09 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
resource "aws_acm_certificate" "this_acm_cert" {
count = local.enable_tls ? 1 : 0
domain_name = "on.${data.aws_route53_zone.this_zone[0].name}"
validation_method = "DNS"
}
resource "aws_route53_record" "this_acm_val_records" {
count = local.enable_tls ? length(aws_acm_certificate.this_acm_cert[0].domain_validation_options) : 0
name = tolist(aws_acm_certificate.this_acm_cert[0].domain_validation_options)[count.index].resource_record_name
records = [tolist(aws_acm_certificate.this_acm_cert[0].domain_validation_options)[count.index].resource_record_value]
type = tolist(aws_acm_certificate.this_acm_cert[0].domain_validation_options)[count.index].resource_record_type
allow_overwrite = true
ttl = 60
zone_id = data.aws_route53_zone.this_zone[0].zone_id
}
resource "aws_acm_certificate_validation" "this_acm_cert_validation" {
count = local.enable_tls ? 1 : 0
certificate_arn = aws_acm_certificate.this_acm_cert[0].arn
validation_record_fqdns = aws_route53_record.this_acm_val_records[*].fqdn
}