-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacm.tf
37 lines (30 loc) · 898 Bytes
/
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
33
34
35
36
37
resource "aws_acm_certificate" "root" {
provider = aws.cloudfront
domain_name = local.domain
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
}
resource "aws_acm_certificate" "wildcard" {
domain_name = "*.${local.domain}"
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
}
resource "aws_acm_certificate_validation" "root" {
provider = aws.cloudfront
certificate_arn = aws_acm_certificate.root.arn
validation_record_fqdns = [for record in aws_route53_record.root_validation : record.fqdn]
timeouts {
create = "5m"
}
}
resource "aws_acm_certificate_validation" "wildcard" {
certificate_arn = aws_acm_certificate.wildcard.arn
validation_record_fqdns = [for record in aws_route53_record.wildcard_validation : record.fqdn]
timeouts {
create = "5m"
}
}