hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

azurerm_cosmosdb_account and misleading setting access_key_metadata_writes_enabled #28014

Open jamesbwilkinson opened 6 days ago

jamesbwilkinson commented 6 days ago

Is there an existing issue for this?

Community Note

Terraform Version

1.7.0

AzureRM Provider Version

4.9.0

Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_account

Terraform Configuration Files

Is related to specific setting "access_key_metadata_writes_enabled" of azurerm_cosmosdb_account.

There are 2 issues here.

1. The wording of this setting is misleading and opposite to the Azure setting. This setting defaults to true in Terraform which makes the Azure resource setting "disableKeyBasedMetadataWriteAccess" set to false.

This leads to some confusion as the wording used in Terraform and Azure settings are in conflict. Could this please be aligned?

Suggestion "access_key_metadata_writes_disabled"

2. The default setting in stated as true, which is not correct. It defaults to false when verifying that on the Azure side.

Debug Output/Panic Output

NA

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

neil-yechenwei commented 5 days ago

Thanks for raising this issue. It's by TF design since "xxx_enabled" meets TF style. Service team confirmed that the default value of DisableKeyBasedMetadataWriteAccess is false, which means access_key_metadata_writes_enabled in TF is enabled. So it's expected.