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

Terraform apply should not be failing when terraform is updating keyvault with soft delete enabled #17815

Closed
1 task done
bamb00 opened this issue Jul 29, 2022 · 3 comments
Closed
1 task done

Comments

@bamb00
Copy link

bamb00 commented Jul 29, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Terraform Version

0.14.0

AzureRM Provider Version

0.14.0

Affected Resource(s)/Data Source(s)

azurerm_key_vault

Terraform Configuration Files

Terraform apply should ignore kv with soft-delete enabled and not failed when the keyvault is getting update.

Debug Output/Panic Output

Error: Error updating Key Vault "xxxxxxxxxx" (Resource Group "xxxxxxxx-xxxx-xxxxxx-xxxxxx-xx"): once Purge Protection has been Enabled it's not possible to disable it

Expected Behaviour

Should skip the kv and not failed the run.

Actual Behaviour

The terraform apply failed with detecting the kv is soft-delete/purge-protection is enabled. The kv is not being purge but it is attempting to update the kv

Steps to Reproduce

  1. kv soft-delete/purge-protection is enabled
  2. terraform apply updating the kv

Important Factoids

No response

References

No response

@bamb00 bamb00 added the bug label Jul 29, 2022
@github-actions github-actions bot removed the bug label Jul 29, 2022
@bamb00 bamb00 changed the title Terraform apply should not failed when updating keyvault and soft delete is enabled Terraform apply should failed when terraform is updating keyvault with soft delete enabled Aug 1, 2022
@bamb00 bamb00 changed the title Terraform apply should failed when terraform is updating keyvault with soft delete enabled Terraform apply shouldn't have failed when terraform is updating keyvault with soft delete enabled Aug 1, 2022
@bamb00 bamb00 changed the title Terraform apply shouldn't have failed when terraform is updating keyvault with soft delete enabled Terraform apply should not be failing when terraform is updating keyvault with soft delete enabled Aug 1, 2022
@magodo
Copy link
Collaborator

magodo commented Aug 3, 2022

@bamb00 Would you please provide a minimal TF config to describe the steps for reproducing the error?

From the description above, it seems in your update on the key vault, you are trying to change the purge_protection_enabled from true to false (note that its default value is false). As is mentioned in this issue, the purge_protection_enabled can't be revert from true to false in Azure. This is why the provider errored with above message.

@bamb00
Copy link
Author

bamb00 commented Aug 3, 2022

Thanks @magodo. I made the change and the TF is running without the errors. I've assume TF will ignore the purge_protection_enabled but had to override the setting.

Thanks for the help!

@bamb00 bamb00 closed this as completed Aug 3, 2022
@github-actions
Copy link

github-actions bot commented Sep 3, 2022

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants