-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
r/key_vault: defaulting soft_delete_enabled
on to match the updated API behaviour
#10088
Conversation
This is done with a 3.0 toggle so this is unavailable when running with the 3.0 functionality enabled.
…etention_days` to 90 This commit conditionally deprecates the `soft_delete_enabled` field and removes it entirely if we're running in 3.0 mode. This also defaults `soft_delete_retention_days` to 90 matching the default value used in the Azure API here, based only on the docs, since this isn't returned if it's not configured by the user.
…_delete_retention_days` cannot be changed after being initially set, due to the behaviour of the Azure API. It's unfortunate we can't make this ForceNew, but this appears to be the least-bad way of supporting this behaviour.
This is required to work around the default that's not returned from the Azure API.
These require it: > === RUN TestAccKeyVaultKey_basicRSAHSM > === PAUSE TestAccKeyVaultKey_basicRSAHSM > === CONT TestAccKeyVaultKey_basicRSAHSM > testing.go:684: Step 0 error: errors during apply: > Error: Error Creating Key: keyvault.BaseClient#CreateKey: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Forbidden" Message="Hardware key operation not allowed on standard vault" InnerError={"code":"HardwareKeysNotSupported"} > === RUN TestAccKeyVaultKey_basicECHSM > === PAUSE TestAccKeyVaultKey_basicECHSM > === CONT TestAccKeyVaultKey_basicECHSM > testing.go:684: Step 0 error: errors during apply: > Error: Error Creating Key: keyvault.BaseClient#CreateKey: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Forbidden" Message="Hardware key operation not allowed on standard vault" InnerError={"code":"HardwareKeysNotSupported"}
This can no longer be disabled, and is defaulted on - so this is unnecessary
For the changelog:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This has been released in version 2.42.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.42.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
This PR updates the
azurerm_key_vault
resource to match the updated API behaviour rolled out over late last month / the new year. Whilst #10007 provides one solution to this, after extensive testing there was ultimately more necessary to make this work, as such this PR includes:azurerm_key_vault
- deprecating the fieldsoft_delete_enabled
(and conditionally removing this should 3.0 mode be enabled)azurerm_key_vault
- deprecating the fieldsoft_delete_enabled
and defaulting this to true (conditionally removing this should 3.0 mode be enabled). Notably this PR removes the error when attempting to disable/enable this - but since this is hard-coded totrue
in the Read function, operators can update their configurations (or remove the field) to clear this diff.azurerm_key_vault
- defaulting the fieldsoft_delete_retention_days
to90
days, to match the API behaviour. Notably it's only possible to set this value a single time (either during create, or one-time during update) at which point it's immutable - so a state migration was necessary to default this if not explicitly set - as it's defaulted in the API but not returned unless explicitly configured.As such this PR supersedes #10007 but fixes #9988 (albeit in a slightly different manner).