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 fails on creating azurerm_key_vault_secret, resource is created but not in the state #13494

Closed
tplive opened this issue Sep 24, 2021 · 2 comments
Labels

Comments

@tplive
Copy link

tplive commented Sep 24, 2021

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

Terraform (and AzureRM Provider) Version

Terraform v1.0.7
azurerm v2.78.0

Affected Resource(s)

  • azurerm_key_vault_secret

Terraform Configuration Files

resource "azurerm_key_vault_secret" "t-domain-join-user" {
  name         = "domain-join-user"
  value        = azuread_user.aadds_admin.user_principal_name
  key_vault_id = module.test_systemXXX.key_vault_id
}

resource "azurerm_key_vault_secret" "t-domain-join-password" {
  name         = "domain-join-password"
  value        = random_password.aadds_admin_password.result
  key_vault_id = module.test_systemXXX.key_vault_id
}

Debug Output

This is part of a larger deployment, and the debug log is > 200k lines.

Panic Output

Expected Behaviour

Actual Behaviour

Key Vault secrets are created in Azure, but the apply session fails. The resources are NOT added to terraform state, so the next run also fails, saying that the resource already exists and needs to be imported.

Terraform output first run: https://gist.github.com/tplive/2fa710e2953248abf678178263fef8a1

Terraform output second run: https://gist.github.com/tplive/bf3861a858a073e1f77d0763bb023874

Steps to Reproduce

  1. terraform apply
  2. terraform applyagain

Important Factoids

Key Vault was created earlier, running a pipeline using a different SP.

References

Same issue, closed with azurerm version 2.46:

@tombuildsstuff
Copy link
Contributor

Duplicate of #11059

@tombuildsstuff tombuildsstuff marked this as a duplicate of #11059 Nov 15, 2021
@github-actions
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 Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants