-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Description
Possiblity to create several dns zones when creating a dns instance via module vpc
For our case at least 6 dns zones are needed for our workloads and I saw that the module only supports creation od one dns zone.
for now here is whatwe do to create the dns zones
variable "hosted_zone_names" {
description = "List of DNS zone names to create"
type = list(string)
default = ["zone2.io","zone3.lan","zone4.net","zone5.cloud"]
}
resource "ibm_dns_zone" "hosted_zones" {
for_each = toset(var.hosted_zone_names)
instance_id = module.vpc_hub["edge-${var.account-type}"].dns_instance_id
name = each.value
description = "Hosted zone for ${each.value}"
label = "dns-zone"
}
resource "ibm_dns_permitted_network" "vpc_edge_perm_network" {
for_each = ibm_dns_zone.hosted_zones
instance_id = each.value.instance_id
zone_id = each.value.zone_id
type = "vpc"
vpc_crn = module.vpc_hub["edge-${var.account-type}"].vpc_crn
}