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

Root resource was present, but now absent. #11782

Closed
nemrood opened this issue May 19, 2021 · 3 comments
Closed

Root resource was present, but now absent. #11782

nemrood opened this issue May 19, 2021 · 3 comments

Comments

@nemrood
Copy link

nemrood commented May 19, 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

TF Version 0.14.5
AZ Version 2.45.1

Affected Resource(s)

  • azurerm_key_vault_secret
  • random_string

Terraform Configuration Files

Main.tf

locals {
  tfsettings = yamldecode(file(var.setting))
}

module "tdf_az_key_vault_secret" {
  for_each       = { for vpnsite in local.tfsettings.vpnsites : vpnsite.name => vpnsite }
  source = "../../modules/tdf_az_key_vault_secret"
  key_vault_id = data.azurerm_key_vault.kv.id
  secret_name  = each.value.name 
  psk = random_string.rs[each.key].result
}

resource "random_string" "rs" {
    for_each       = { for vpnsite in local.tfsettings.vpnsites : vpnsite.name => vpnsite }
    length       = 14
    min_upper    = 2
    min_lower    = 2
    min_numeric  = 2
    min_special  = 2
}

Module.tf

resource "azurerm_key_vault_secret" "psk" {
  name         = var.secret_name
  value        = var.psk
  key_vault_id = var.key_vault_id
}

Debug Output

module.tdf_az_key_vault_secret["TDFHB"].azurerm_key_vault_secret.psk: Still creating... [2m0s elapsed]
module.tdf_az_key_vault_secret["TS"].azurerm_key_vault_secret.psk: Still creating... [2m0s elapsed]
module.tdf_az_key_vault_secret["TAS"].azurerm_key_vault_secret.psk: Still creating... [2m0s elapsed]
module.tdf_az_key_vault_secret["EIP"].azurerm_key_vault_secret.psk: Still creating... [2m0s elapsed]
Error: Provider produced inconsistent result after apply
When applying changes to
module.tdf_az_key_vault_secret["TS"].azurerm_key_vault_secret.psk, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Error: Provider produced inconsistent result after apply
When applying changes to
module.tdf_az_key_vault_secret["EIP"].azurerm_key_vault_secret.psk, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Error: Provider produced inconsistent result after apply
When applying changes to
module.tdf_az_key_vault_secret["TDFHB"].azurerm_key_vault_secret.psk, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Error: Provider produced inconsistent result after apply
When applying changes to
module.tdf_az_key_vault_secret["TAS"].azurerm_key_vault_secret.psk, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Panic Output

N/A

Expected Behaviour

It shoud have generated one random string for each vpnsite and create a secret on azure keyvault using that random string as a value and the vpnsite name as a name for the secret.

Actual Behaviour

Check error above.

Steps to Reproduce

Terraform Init
Terraform Validate
Terraform Plan
Terraform Apply

@magodo
Copy link
Collaborator

magodo commented May 20, 2021

@nemrood Thank you for submitting this!

This seems to be duplicated to #11059, in order not to duplicate, would you mind to subscribe that issue for tracking the progress?

@tombuildsstuff
Copy link
Contributor

Closing in favour of #11059

@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 Jul 26, 2021
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

3 participants