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

Upstream Azure API error unable to create azurerm_recovery_services_vault with immutability locked #23792

Closed
1 task done
davepattie opened this issue Nov 6, 2023 · 2 comments · Fixed by #23806
Closed
1 task done

Comments

@davepattie
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.7

AzureRM Provider Version

3.77

Affected Resource(s)/Data Source(s)

azurerm_recovery_services_vault

Terraform Configuration Files

provider "azurerm" {
  features {}
}

locals {
  location  = "eastus"
  name      = "backup-test"
}

resource "azurerm_resource_group" "resource_group" {
  location = local.location
  name     = format("rg-%s", local.name)
}

resource "azurerm_recovery_services_vault" "recovery_vault" {
  name                = format("rsv-%s", local.name)
  location            = local.location
  resource_group_name = azurerm_resource_group.resource_group.name
  immutability        = "Locked"
  sku                 = "Standard"
}

Debug Output/Panic Output

Vault Name: "rsv-backup-test"): performing CreateOrUpdate: unexpected status 400 with error: UserErrorUnsupportedVaultImmutabilityStateChange: The immutable vault property for this vault is locked, hence, this setting cannot be disabled. The vault has its immutable vault property enabled and locked, and it can no longer be reverted to a non-immutable vault. Refer to the documentation to learn more: https://aka.ms/AB-ImmutableVaults-States

Expected Behaviour

Recovery Vault is created

Actual Behaviour

No vault is created and error is thrown

Steps to Reproduce

terraform init
terraform apply

It is not a terraform issue but one of the Azure CLI. It can also be reproduced running the command:
az backup vault create --location eastus --name rsv-backup-test --resource-group rg-backup-test --immutability-state Locked

The workaround is to create the vault first unlocked and then reapply the configuration with the vault locked. Documenting here so it can be linked to a Microsoft API issue, thank

Important Factoids

No response

References

No response

@ziyeqf
Copy link
Contributor

ziyeqf commented Nov 7, 2023

Hi @davepattie, thanks for reporting.

per tesing, the immutability can not be directly set to Locked from Disabled, and it acts as same as Portal, which I personally assume it's by design. I have submiteed a PR to let terraform manage this correctly (#23806). Once it merged it should work fine.

Thanks!

@github-actions github-actions bot added this to the v3.86.0 milestone Jan 4, 2024
Copy link

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 Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants