'Public_network_access_enabled' argument is not supported with terraform azurerm version 3.21.0

sachin gupta 376 Reputation points
2023-01-18T01:35:31.07+00:00

I wanted to disabled the public network access in azure keyvault, for that I am running terraform script and added the argument public_network_access_enabled argument in main.tf file. Also, I have upgraded the azurerm version = 3.21.0 as per terraform documentation. when I ran the terraform, I am getting below error.

Error - public_network_access_enabled argument is not expected.

Please find below screenshot of the configurations.

Main.tf=main.tf

variable.tf = variable.tf

version.tf =version file

Please share your suggestion.

Thank you!

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,126 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SanthiSwaroopNaikBukke-4908 595 Reputation points
    2023-01-20T20:16:06.0666667+00:00

    In the code you provided, the public_network_access_enabled variable is set to var.public_network_access_enabled. You can change the value of this variable to false to disable public network access for the Key Vault.