terraform-provider-vault icon indicating copy to clipboard operation
terraform-provider-vault copied to clipboard

Cannot refresh state if `vault_ldap_auth_backend` is missing from Vault

Open anarsen opened this issue 2 years ago • 4 comments

Terraform Version

Terraform v1.3.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/vault v3.11.0

Affected Resource(s)

  • vault_ldap_auth_backend

Terraform Configuration Files

resource "vault_ldap_auth_backend" "this" {
  # attributes omitted
}

Debug Output

https://gist.github.com/anarsen/00e8c1fdafa820d5bcfceff80da5c48c

Expected Behavior

Terraform would realize the vault_ldap_auth_backend doesn't exist during the refresh phase, and produce a plan to create it.

Actual Behavior

Errors out with this message

Error: auth mount ldap not present

I assume this is the offending code: https://github.com/hashicorp/terraform-provider-vault/blob/main/vault/resource_ldap_auth_backend.go#L346

Steps to Reproduce

  1. vault server -dev
  2. terraform apply
  3. Stop Vault dev server
  4. vault server -dev
  5. terraform apply or terraform refresh

anarsen avatar Dec 09 '22 08:12 anarsen