Skip to content

feature to create multiple dns zones with the module #1070

@hFti

Description

@hFti

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
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions