-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprivate-dns.tf
More file actions
25 lines (21 loc) · 821 Bytes
/
private-dns.tf
File metadata and controls
25 lines (21 loc) · 821 Bytes
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
locals {
// This ensures that the DNS name is specified as a proper FQDN (i.e. has a trailing `.`)
safe_internal_dns_name = "${trimsuffix(var.internal_subdomain, ".")}."
}
resource "google_dns_managed_zone" "internal" {
count = var.internal_subdomain == "" ? 0 : 1
name = "internal-${local.resource_name}"
dns_name = local.safe_internal_dns_name
description = "Internal DNS zone for ${local.resource_name}"
labels = local.labels
visibility = "private"
private_visibility_config {
networks {
network_url = google_compute_network.this.id
}
}
}
locals {
internal_domain_fqdn = var.internal_subdomain == "" ? "" : google_dns_managed_zone.internal[0].dns_name
internal_domain_zone_id = var.internal_subdomain == "" ? "" : google_dns_managed_zone.internal[0].name
}