Skip to content

Commit 921b887

Browse files
committed
fix: addressed review changes
1 parent 0efb038 commit 921b887

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ resource "ibm_dns_permitted_network" "dns_permitted_network" {
383383
##############################################################################
384384

385385
resource "ibm_dns_resource_record" "dns_record" {
386-
387-
for_each = { for idx, record in var.dns_records : idx => record }
386+
for_each = length(ibm_dns_zone.dns_zone) > 0 ? { for idx, record in var.dns_records : idx => record } : {}
388387
instance_id = var.use_existing_dns_instance ? var.existing_dns_instance_id : ibm_resource_instance.dns_instance_hub[0].guid
389388
zone_id = ibm_dns_zone.dns_zone[0].zone_id
390389
name = each.value.name

0 commit comments

Comments
 (0)