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.48k stars 4.56k forks source link

Make Support for making key vault cache population togglable #26504

Open alex-goncharov opened 3 weeks ago

alex-goncharov commented 3 weeks ago

Is there an existing issue for this?

Community Note

Description

Commit https://github.com/hashicorp/terraform-provider-azurerm/commit/f61338f31fe3cb90ec7ad112659ada0b43f31a1d introduced cache for key vaults, which gets a list of all key vaults in the subscription and then reads each for up to date details.

This poses a problem for subscriptions with a substantial amount of key vaults and a noticeable rate of changes, where one or two plans can lock down a subscription by hitting API rate limits.

Is it possible to make the cache feature togglable via provider configuration?

New or Affected Resource(s)/Data Source(s)

azurerm_key_vault

Potential Terraform Configuration

provider "azurerm" {
  features {
    key_vault {
     enable_cache = true|false
    }
  }
}

References

No response

alex-goncharov commented 3 weeks ago

With one of the subscriptions that look like this

$ az resource list --resource-type Microsoft.KeyVault/vaults --subscription XXX | jq '. | length'
894

An "application shell" in this subscription has a single KV in its resource group, and a couple of PRs lock the whole set-up down on version 3.106. 3.105 works fine.