Add DNS record for custom domain

This commit is contained in:
Julio Diez 2023-02-23 19:44:37 +01:00
parent 8d1edea487
commit 3f45e75c35
1 changed files with 14 additions and 1 deletions

View File

@ -310,7 +310,7 @@ resource "google_compute_global_forwarding_rule" "psc_endpoint_prj1" {
module "ilb-l7" {
source = "../../../modules/net-ilb-l7"
count = var.custom_domain != null ? 1 : 0
count = var.custom_domain == null ? 0 : 1
project_id = module.project_main.project_id
name = "ilb-l7-cr"
region = var.region
@ -461,6 +461,19 @@ module "private_dns_main" {
}
}
module "private_dns_main_custom" {
source = "../../../modules/dns"
count = var.custom_domain == null ? 0 : 1
project_id = module.project_main.project_id
type = "private"
name = "dns-main-custom"
client_networks = [module.vpc_main.self_link]
domain = format("%s.", var.custom_domain)
recordsets = {
"A " = { records = [module.ilb-l7[0].address] }
}
}
module "private_dns_onprem" {
source = "../../../modules/dns"
count = length(module.project_onprem)