Skip to content

Commit a1156a9

Browse files
committed
add warning if domain set but cloudflare not enabled
1 parent 29b8ed1 commit a1156a9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

dns.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
check "dns_configuration" {
3+
assert {
4+
condition = !(var.base_domain != "" && var.app_subdomain != "" && !var.enable_cloudflare_dns)
5+
error_message = "Base domain and app subdomain are configured but enable_cloudflare_dns is false. DNS record will not be created."
6+
}
7+
}
8+
29
# DNS CNAME record for application subdomain pointing to Google Cloud Run
310
resource "cloudflare_record" "app" {
411
count = var.enable_cloudflare_dns && var.base_domain != "" ? 1 : 0

0 commit comments

Comments
 (0)