Skip to content

Commit 3c1fd26

Browse files
SC-Tobiassreallymatt
authored andcommitted
azurerm_storage_account - Update default value to the Azure Default (hashicorp#31596)
Co-authored-by: sreallymatt <106555974+sreallymatt@users.noreply.github.com>
1 parent b766e14 commit 3c1fd26

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

internal/services/storage/storage_account_resource.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func resourceStorageAccount() *pluginsdk.Resource {
333333
"allow_nested_items_to_be_public": {
334334
Type: pluginsdk.TypeBool,
335335
Optional: true,
336-
Default: true,
336+
Default: false,
337337
},
338338

339339
"shared_access_key_enabled": {
@@ -1355,6 +1355,12 @@ func resourceStorageAccount() *pluginsdk.Resource {
13551355
},
13561356
Deprecated: "this block has been deprecated and superseded by the `azurerm_storage_account_queue_properties` resource and will be removed in v5.0 of the AzureRM provider",
13571357
}
1358+
1359+
resource.Schema["allow_nested_items_to_be_public"] = &pluginsdk.Schema{
1360+
Type: pluginsdk.TypeBool,
1361+
Optional: true,
1362+
Default: true,
1363+
}
13581364
}
13591365

13601366
return resource
@@ -2186,7 +2192,10 @@ func resourceStorageAccountFlatten(ctx context.Context, d *pluginsdk.ResourceDat
21862192

21872193
// NOTE: The Storage API returns `null` rather than the default value in the API response for existing
21882194
// resources when a new field gets added - meaning we need to default the values below.
2189-
allowBlobPublicAccess := true
2195+
allowBlobPublicAccess := false
2196+
if !features.FivePointOh() {
2197+
allowBlobPublicAccess = true
2198+
}
21902199
if props.AllowBlobPublicAccess != nil {
21912200
allowBlobPublicAccess = *props.AllowBlobPublicAccess
21922201
}

website/docs/5.0-upgrade-guide.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ Please follow the format in the example below for listing breaking changes in re
448448
* The property `min_tls_version` no longer accepts `TLS1_0` or `TLS1_1` as a value.
449449
* The deprecated `queue_properties` block has been removed and superseded by the `azurerm_storage_account_queue_properties` resource.
450450
* The deprecated `static_website` block has been removed and superseded by the `azurerm_storage_account_static_website` resource.
451+
* The property `allow_nested_items_to_be_public` now defaults to `false`.
451452

452453
### `azurerm_storage_account_customer_managed_key`
453454

0 commit comments

Comments
 (0)