We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0efb038 commit 921b887Copy full SHA for 921b887
main.tf
@@ -383,8 +383,7 @@ resource "ibm_dns_permitted_network" "dns_permitted_network" {
383
##############################################################################
384
385
resource "ibm_dns_resource_record" "dns_record" {
386
-
387
- for_each = { for idx, record in var.dns_records : idx => record }
+ for_each = length(ibm_dns_zone.dns_zone) > 0 ? { for idx, record in var.dns_records : idx => record } : {}
388
instance_id = var.use_existing_dns_instance ? var.existing_dns_instance_id : ibm_resource_instance.dns_instance_hub[0].guid
389
zone_id = ibm_dns_zone.dns_zone[0].zone_id
390
name = each.value.name
0 commit comments