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

Resource Snowflake User setting password to null doesnt remove their password (Unset Password) #1535

Closed
culpgrant opened this issue Feb 15, 2023 · 4 comments
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:user Issue connected to the snowflake_user resource

Comments

@culpgrant
Copy link

Provider Version

0.53.0

Terraform Version

1.3.6

Describe the bug

We previously had users created with a password and are switching them to a different auth method. So I want to set the password to null so they can't login using basic authentication. When I set the password parameter to null it doesn't recognize this as a change.

Expected behavior

I would expect TF to run this SQL statement alter user <username> unset password;

But it is not recognizing that this user needs tobe adjusted as I am not getting back any changes in the terraform plan.

This unsets the password for that user.

Code samples and commands

resource "snowflake_user" "USER" {
  name              = "USER"
  login_name        = "USER"
  display_name      = "USER"
  first_name        = "FIRST"
  last_name         = "LAST"
  email             = "email"
  comment           = "comment"
  disabled          = false
  password        = null
}

Additional context

@culpgrant culpgrant added the bug Used to mark issues with provider's incorrect behavior label Feb 15, 2023
@git-benjamin
Copy link

The password requires a string and doesn't accept boolean values as per the docs.

I'd try removing the password line which might remove the password from the user.

If that doesn't work I'd suggest destroying the user and create them again without a password.

@culpgrant
Copy link
Author

Gotcha that is a good point this might be a feature enhancement.

@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:user Issue connected to the snowflake_user resource labels May 20, 2024
sfc-gh-asawicki added a commit that referenced this issue Aug 28, 2024
Fix known user resource-connected issues:
- Change the sensitiveness of name and login_name (References: #2662
#2668)
- Handle "null" properly for the nullable bool text attributes in user
(References: #2817)
- Fix diff suppression for default_x in user resource (References:
#2836)
- Update the migration guide (References #2938 #2942)
- Fix incorrect state after failed to alter (References #2970)
- Confirm the problem with the computed disabled attribute (References
#1572)
- Confirm that the problem with the null-out password was already solved
(References #1535)
- Add TODO to handle days to expiry in user (References #1155)

The next 2 PRs will contain:
- adjusting user resource to our rework conventions (also adding
additional fields and handling #1155 and #1572)
- adjusting user datasource (will handle #2902)

User rework will not include handling new types of users (service,
legacy service); this will be done a bit later.
@sfc-gh-asawicki
Copy link
Collaborator

Hey @culpgrant, the change #3013 confirms that this problem is not reproducible in the newest provider version. Please migrate and confirm that it works.

@culpgrant
Copy link
Author

Hey @culpgrant, the change #3013 confirms that this problem is not reproducible in the newest provider version. Please migrate and confirm that it works.

You can close - I am no longer using this provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:user Issue connected to the snowflake_user resource
Projects
None yet
Development

No branches or pull requests

4 participants