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

Fix removal of policies, member_group_ids, and member_entity_ids from the vault_identity_group resource. #766

Merged
merged 3 commits into from
May 21, 2020

Conversation

austingebauer
Copy link
Member

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #620

This PR fixes removal of policies from the vault_identity_group resource as described in #620. The same problem existed for both member_group_ids and member_entity_ids, so I fixed that in this PR as well.

Additionally, I noticed that member_group_ids can't be set for external groups (see vault/identity_store_groups.go#L250), so this PR now treats them similarly to member_entity_ids for external groups.

Release note for CHANGELOG:

BUG FIXES:
* Fix removal of `policies`, `member_group_ids`, and `member_entity_ids` from the `vault_identity_group` resource.

Output from acceptance testing:

$ TESTARGS="--run IdentityGroup" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v --run IdentityGroup -timeout 120m
?       github.com/terraform-providers/terraform-provider-vault [no test files]
?       github.com/terraform-providers/terraform-provider-vault/cmd/coverage    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/util    0.580s [no tests to run]
=== RUN   TestDataSourceIdentityGroupName
--- PASS: TestDataSourceIdentityGroupName (0.14s)
=== RUN   TestDataSourceIdentityGroupAlias
--- PASS: TestDataSourceIdentityGroupAlias (0.14s)
=== RUN   TestAccIdentityGroupAlias
--- PASS: TestAccIdentityGroupAlias (0.11s)
=== RUN   TestAccIdentityGroupAliasUpdate
--- PASS: TestAccIdentityGroupAliasUpdate (0.19s)
=== RUN   TestAccIdentityGroupPoliciesExclusive
--- PASS: TestAccIdentityGroupPoliciesExclusive (0.17s)
=== RUN   TestAccIdentityGroupPoliciesNonExclusive
--- PASS: TestAccIdentityGroupPoliciesNonExclusive (0.18s)
=== RUN   TestAccIdentityGroup
--- PASS: TestAccIdentityGroup (0.09s)
=== RUN   TestAccIdentityGroupUpdate
--- PASS: TestAccIdentityGroupUpdate (0.37s)
=== RUN   TestAccIdentityGroupExternal
--- PASS: TestAccIdentityGroupExternal (0.09s)
PASS
ok      github.com/terraform-providers/terraform-provider-vault/vault   1.891s

Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks Austin!

@tyrannosaurus-becks tyrannosaurus-becks merged commit 122c88b into master May 21, 2020
@tyrannosaurus-becks tyrannosaurus-becks deleted the fix-identity-group-lists branch May 21, 2020 18:33
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
… the vault_identity_group resource. (hashicorp#766)

* fix: identity group policies can be deleted

* test: adds identity group test coverage

* docs: updates comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vault_identity_group cannot remove all policies from an identity group
2 participants