-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_keyvault_key
: udpate client cache logic to support managedHSM keys
#24209
Conversation
@wuxu92 FWIW Managed HSMs shouldn't be using the same cache as Key Vaults as they're different products (and not 100% interchangeable, since not every service which supports Key Vault supports Managed HSM - and there's behavioural differences between them) - so can we split this cache into one for Managed HSM and another for Key Vault to allow for this differentiation? |
@tombuildsstuff Sure, that makes sense! I'll update it this way. |
split keyvault/mhsm with separate cache instance restore parseNameFromBaseUrl restore parseNameFromBaseUrl
I have updated the PR to utilize a distinct cache instance for keyvault. I have kept the signature of the cache-related methods unchanged to avoid breaking them. Additionally, I will include a managedHSM cache instance in the pull request for the managed HSM key resource. |
@wuxu92 I've spend some more time digging into Key Vault and Managed HSM this morning as a part of determining what's needed to move Key Vault to the new base layer. As a part of that, I've opened #24737 which splits Since these are now going to be entirely isolated Service Packages, rather than try to combine this into the existing cache for Key Vaults - it'd be better to duplicate the Key Vault cache that we've got for Managed HSMs, as such would you mind updating this? Would you also mind elaborating on the use-case for this cache? Thanks! |
@tombuildsstuff I'm currently developing key resources for managedHSM, and it requires the same cache logic as the keyvault cache. Since managedHSM will be separate from the keyvault package, I will update this PR once #24737 is merged. |
@katbyte I apologize for the delayed response. As the managedHSM is now in a separate package, I will close this pull request since the cache logic is completely different from what was initially proposed. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
The current version's cache logic only supports key vault keys. This PR refactors the cache to accommodate various vault IDs, such as manage HSM. Presently, existing locks seem fail to prevent simultaneous read/write operations on the
keyVaultCache
map by merely locking a specific cacheKey.