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

Terraform not able to manage user parameters #2313

Closed
josescuderoh opened this issue Jan 2, 2024 · 1 comment
Closed

Terraform not able to manage user parameters #2313

josescuderoh opened this issue Jan 2, 2024 · 1 comment

Comments

@josescuderoh
Copy link

josescuderoh commented Jan 2, 2024

Summary

When creating a user parameter like QUERY_TAG, through terraform, the resource is created but it cannot be read, resulting in the below error every time that one tries to read the plan after creation

│ Error: error reading object parameter err = unsupported object type ...

I'm trying to recreate the below SQL statement, which works if executed in the console:

ALTER USER "MYUSER" SET QUERY_TAG = '\'{\"user\": \"MYUSER\", \"env\" : \"dev\", \"service\" : \"snowflake\"}\''

Likely cause

After digging in the logic a bit, it seems that the function ShowObjectParameter does not support the User object, which causes an error when it's called from ReadObjectParameter or CreateObjectParameter

Steps to reproduce

Create a query tag as:

resource "snowflake_object_parameter" "qt" {
  key         = "QUERY_TAG"
  value       = "somevalue"
  object_type = "USER"
  object_identifier {
    name = snowflake_user.myuser.name
  }
}

Run terraform plan and terraform apply. You should see the above error but you should be able to see the query tag in snowflake with show parameters like '%query_tag%' for user myuser;

@josescuderoh
Copy link
Author

realized I should be using session parameters instead of object parameters

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

No branches or pull requests

1 participant