@@ -34,7 +34,7 @@ resource "azurerm_storage_account" "storage_account" {
3434 sftp_enabled = local. storage_account [each . key ]. sftp_enabled
3535
3636 dynamic "custom_domain" {
37- for_each = flatten (compact (values (local. storage_account [each . key ]. custom_domain ))) == [] ? [] : [0 ]
37+ for_each = length (compact (values (local. storage_account [each . key ]. custom_domain ))) > 0 ? [0 ] : []
3838
3939 content {
4040 name = local. storage_account [each . key ]. custom_domain . name
@@ -52,7 +52,7 @@ resource "azurerm_storage_account" "storage_account" {
5252 }
5353
5454 dynamic "identity" {
55- for_each = flatten (compact (values (local. storage_account [each . key ]. identity ))) == [] ? [] : [0 ]
55+ for_each = length (compact (values (local. storage_account [each . key ]. identity ))) > 0 ? [0 ] : []
5656
5757 content {
5858 type = local. storage_account [each . key ]. identity . type
@@ -125,7 +125,7 @@ resource "azurerm_storage_account" "storage_account" {
125125 }
126126
127127 dynamic "logging" {
128- for_each = flatten (compact (values (local. storage_account [each . key ]. queue_properties . logging ))) == [] ? [] : [0 ]
128+ for_each = length (compact (values (local. storage_account [each . key ]. queue_properties . logging ))) > 0 ? [0 ] : []
129129
130130 content {
131131 delete = local. storage_account [each . key ]. queue_properties . logging . delete
@@ -137,7 +137,7 @@ resource "azurerm_storage_account" "storage_account" {
137137 }
138138
139139 dynamic "minute_metrics" {
140- for_each = flatten (compact (values (local. storage_account [each . key ]. queue_properties . minute_metrics ))) == [] ? [] : [0 ]
140+ for_each = length (compact (values (local. storage_account [each . key ]. queue_properties . minute_metrics ))) > 0 ? [0 ] : []
141141
142142 content {
143143 enabled = local. storage_account [each . key ]. queue_properties . minute_metrics . enabled
@@ -148,7 +148,7 @@ resource "azurerm_storage_account" "storage_account" {
148148 }
149149
150150 dynamic "hour_metrics" {
151- for_each = flatten (compact (values (local. storage_account [each . key ]. queue_properties . hour_metrics ))) == [] ? [] : [0 ]
151+ for_each = length (compact (values (local. storage_account [each . key ]. queue_properties . hour_metrics ))) > 0 ? [0 ] : []
152152
153153 content {
154154 enabled = local. storage_account [each . key ]. queue_properties . hour_metrics . enabled
@@ -161,7 +161,7 @@ resource "azurerm_storage_account" "storage_account" {
161161 }
162162
163163 dynamic "static_website" {
164- for_each = flatten (compact (values (local. storage_account [each . key ]. static_website ))) == [] ? [] : [0 ]
164+ for_each = length (compact (values (local. storage_account [each . key ]. static_website ))) > 0 ? [0 ] : []
165165
166166 content {
167167 index_document = local. storage_account [each . key ]. static_website . index_document
@@ -186,15 +186,15 @@ resource "azurerm_storage_account" "storage_account" {
186186 }
187187
188188 dynamic "retention_policy" {
189- for_each = flatten (compact (values (local. storage_account [each . key ]. share_properties . retention_policy ))) == [] ? [] : [0 ]
189+ for_each = length (compact (values (local. storage_account [each . key ]. share_properties . retention_policy ))) > 0 ? [0 ] : []
190190
191191 content {
192192 days = local. storage_account [each . key ]. share_properties . retention_policy . days
193193 }
194194 }
195195
196196 dynamic "smb" {
197- for_each = flatten (compact (values (local. storage_account [each . key ]. share_properties . smb ))) == [] ? [] : [0 ]
197+ for_each = length (compact (values (local. storage_account [each . key ]. share_properties . smb ))) > 0 ? [0 ] : []
198198
199199 content {
200200 versions = local. storage_account [each . key ]. share_properties . smb . versions
@@ -217,7 +217,7 @@ resource "azurerm_storage_account" "storage_account" {
217217 virtual_network_subnet_ids = local. storage_account [each . key ]. network_rules . virtual_network_subnet_ids
218218
219219 dynamic "private_link_access" {
220- for_each = flatten (compact (values (local. storage_account [each . key ]. network_rules . private_link_access ))) == [] ? [] : [0 ]
220+ for_each = length (compact (values (local. storage_account [each . key ]. network_rules . private_link_access ))) > 0 ? [0 ] : []
221221
222222 content {
223223 endpoint_resource_id = local. storage_account [each . key ]. network_rules . private_link_access . endpoint_resource_id
@@ -259,7 +259,7 @@ resource "azurerm_storage_account" "storage_account" {
259259 }
260260
261261 dynamic "sas_policy" {
262- for_each = flatten (compact (values (local. storage_account [each . key ]. sas_policy ))) == [] ? [] : [0 ]
262+ for_each = length (compact (values (local. storage_account [each . key ]. sas_policy ))) > 0 ? [0 ] : []
263263
264264 content {
265265 expiration_period = local. storage_account [each . key ]. sas_policy . expiration_period
@@ -268,7 +268,7 @@ resource "azurerm_storage_account" "storage_account" {
268268 }
269269
270270 dynamic "routing" {
271- for_each = flatten (compact (values (local. storage_account [each . key ]. routing ))) == [] ? [] : [0 ]
271+ for_each = length (compact (values (local. storage_account [each . key ]. routing ))) > 0 ? [0 ] : []
272272
273273 content {
274274 publish_internet_endpoints = local. storage_account [each . key ]. routing . publish_internet_endpoints
0 commit comments