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

Terraform Destroy on Role Grant will remove ALL users in Role, not a specific user

Open knighteagle789 opened this issue 4 years ago • 4 comments

When I run a terraform Role_Grant, it adds the specific user as expected. But when I run the destroy afterward, it queries out and grabs All of the users for that role and removes them.

I would expect to only see the specific user that was added to the role to be removed from the role.

knighteagle789 avatar May 07 '20 22:05 knighteagle789

i am having the same issue version 0.15.0

ahaffar avatar Sep 22 '20 13:09 ahaffar

@knighteagle789 did the plan list all users, or only the one in your configuration?

ryanking avatar Sep 22 '20 20:09 ryanking

I think this may unfortunately end up being a result of the way we have to implement the read path for these resources. The grant resources all have to be exclusive currently.

ryanking avatar Dec 10 '20 23:12 ryanking

@ryanking has there been any further discussion on this? I'm finding that if I've used the role_grants resource to grant a user to a role and then remove that user, the user will be destroyed but the entire role_grants object will also be destroyed, rather than just removing that user from the role_grants object.

When destroying a user or role, is it possible to remove only the users or roles granted in that particular module instead of destroying the role grant entirely?

cstkpk avatar Mar 31 '21 19:03 cstkpk

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

sfc-gh-asawicki avatar Apr 30 '24 17:04 sfc-gh-asawicki