-
Notifications
You must be signed in to change notification settings - Fork 0
/
certs.tf
28 lines (25 loc) · 1.15 KB
/
certs.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
#https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/certificate_manager_dns_authorization
resource "google_certificate_manager_dns_authorization" "default" {
name = "hub-default-dnsauth-${random_id.rnd.hex}"
description = "Certificate DNS Auth for Hub UI subdomain"
domain = local.values.project.domain
}
#https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/certificate_manager_certificate
resource "google_certificate_manager_certificate" "root_cert" {
name = "hub-default-rootcert"
description = "hub default wildcard cert"
managed {
domains = [local.values.project.domain, "*.${local.values.project.domain}"]
dns_authorizations = [
google_certificate_manager_dns_authorization.default.id
]
}
}
output "dns_record_name" {
value = google_certificate_manager_dns_authorization.default.dns_resource_record[0].name
description = "The DNS record name for the DNS challenge"
}
output "dns_cname_value" {
value = google_certificate_manager_dns_authorization.default.dns_resource_record[0].data
description = "The CNAME value for the DNS challenge"
}