@@ -10,8 +10,7 @@ locals {
1010 needs_cdn_cert_pack = data. cloudflare_zone . cdn . name != var. domain_cdn
1111}
1212
13- # TODO: Only if we use deprecated subdomains
14- # Allow CLoudflare to serve TLS requests at the edge for our wildcard
13+ # Allow Cloudflare to serve TLS requests at the edge for our wildcard
1514# subdomains.
1615#
1716# This requires paying money for these certs.
@@ -25,13 +24,19 @@ resource "cloudflare_certificate_pack" "main" {
2524 certificate_authority = " lets_encrypt"
2625 # The certificate must include the root domain in it.
2726 #
28- # We convert to set then back to list to remove potential duplicates of the root zoon.
29- hosts = sort (tolist (toset ([
30- data . cloudflare_zone . main . name ,
31- var . domain_main ,
32- " *.${ var . domain_main } " ,
33- " *.api.${ var . domain_main } " ,
34- ])))
27+ # We convert to set then back to list to remove potential duplicates of the root zone.
28+ hosts = sort (tolist (toset (
29+ flatten ([
30+ [
31+ data . cloudflare_zone . main . name ,
32+ var . domain_main ,
33+ " *.${ var . domain_main } " ,
34+ # TODO: Only if we use deprecated subdomains
35+ " *.api.${ var . domain_main } " ,
36+ ],
37+ var . opengb_enabled ? [" *.opengb.${ var . domain_main } " ] : []
38+ ])
39+ )))
3540 type = " advanced"
3641 validation_method = " txt"
3742 validity_days = 90
0 commit comments