Skip to content
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

key-vault/nested items: support for purging deleted items #9911

Merged
merged 18 commits into from
Dec 17, 2020

Conversation

tombuildsstuff
Copy link
Member

This PR introduces Purging for Nested Items (e.g. Certificates, Keys and Secrets) during deletion - like we do for the Key Vaults themselves. This behaviour can be opted-out of using the purge_soft_delete_on_destroy flag (which is reused in the same way that the recover_soft_deleted_key_vaults flag is reused between Key Vaults and Nested Items)

This also fixes an issue where the Key Vault Data Plane API is eventually consistent, by polling to ensure the Nested Item is fully deleted (and subsequently fully purged, if we're opted-into that) during the Delete function.

This change is necessary to workaround an upcoming breaking change happening on December 31st where all Key Vaults get Soft-Delete force-enabled by default and have no means of disabling that - as such to retain the same behaviour as exists today Nested Items must (presuming the users opted in) now be purged during deletion (since users have already confirmed they want to delete these items via approving the terraform plan).

Fixes #5659

…ring

This field is optional, so this makes sense to be optional or a UUID
…ture flag

Whilst initially I was intending to use a separate `purge_nested_items_on_destroy` flag
the "recover" feature flag is shared between the Key Vault and it's Nested Items - as such
to mirror that behaviour I'm reusing that feature flag.
This is implied since the resource doesn't support Update
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tombuildsstuff - Couple of minor observations on the docs, but otherwise LGTM 👍

website/docs/r/key_vault_certificate.html.markdown Outdated Show resolved Hide resolved
website/docs/r/key_vault_key.html.markdown Outdated Show resolved Hide resolved
@ghost ghost added size/XXL and removed size/XL labels Dec 17, 2020
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tombuildsstuff
Copy link
Member Author

Tests pass:

Screenshot 2020-12-17 at 17 47 41

@tombuildsstuff tombuildsstuff merged commit c17449f into master Dec 17, 2020
@tombuildsstuff tombuildsstuff deleted the f/key-vault-soft-delete branch December 17, 2020 16:48
tombuildsstuff added a commit that referenced this pull request Dec 17, 2020
@ghost
Copy link

ghost commented Dec 17, 2020

This has been released in version 2.41.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.41.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jan 17, 2021

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

key vault soft-delete causing failure when updating secrets or certificates
3 participants