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

vault_identity_group resource fails to recreate group if missing from Vault

Open czembower opened this issue 2 years ago • 1 comments

Terraform Version

1.2.4

Affected Resource(s)

  • vault_identity_group

Terraform Configuration Files

resource "vault_identity_group" "this" {
  name     = "test"
  type     = "internal"
  policies = ["this"]

  member_entity_ids = null
}

Debug Output

Full gist example: https://gist.github.com/czembower/57288bdc796fca9e301abb50ac48ba05

Error: error checking if IdentityGroup "this" exists: entity not found: "/identity/group/id/a86ebf5a-56c1-ba33-a926-20675ab65ab6"
with vault_identity_group.this
on vault_oidc.tf line 5, in resource "vault_identity_group" "this":
resource "vault_identity_group" "this" {

Expected Behavior

Provider should create the missing resource

Actual Behavior

Provider errors, does not create missing resource. After removing the resource from the state file, the plan/apply succeeds.

Steps to Reproduce

  1. Create vault_identity_group via terraform
  2. Delete vault identity group via some means other than terraform
  3. terraform plan

czembower avatar Jul 07 '22 20:07 czembower

@czembower Facing the same issue during Plan time in our pipeline - following.

tobsval avatar Aug 07 '22 10:08 tobsval