-
Notifications
You must be signed in to change notification settings - Fork 427
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
[Bug]: User network policy attachment gets deleted every apply #3058
Comments
In case it's relevant, this started happening after an upgrade to 0.95.0 |
Hey @Symbianx. Thanks for reaching out to us. The migration guide to v0.95.0 is missing this, but it will be added soon (maybe even today). Please check #3048 (comment). This is expected behavior starting with v0.95.0. |
Added here:
|
@sfc-gh-asawicki How does this work when user is created with |
Hey @ffmc-mayank. If you want to have different roles creating different resources through Terraform, currently, you should define provider aliases. |
Hi @sfc-gh-asawicki thanks for quick reply. Sorry I should have been clearer with my question. I am already using aliases for managing different roles but the common problem that I had faced in the past when we used to do user creation manually is the resource "snowflake_user" "non_svc_users" {
for_each = local.user_info
provider = snowflake.user_admin
name = each.key
display_name = each.key
login_name = "${each.key}@email.domain"
email = "${each.key}@email.domain"
default_role = each.value["default_role"]
default_warehouse = snowflake_warehouse.dev_wh.name
network_policy = snowflake_network_policy.account_default_policy.name
} |
There are no restrictions documented here: https://docs.snowflake.com/en/sql-reference/sql/create-user#access-control-requirements, so I would assume it should work the way you described. I have not tested this particular setup, though. |
@sfc-gh-asawicki I tested and it's failing as I would expect with error This is the reason I was using |
Hey @ffmc-mayank, thanks for checking it out. The current solution would be to either:
This is not the first issue of that type (example here: #3019). We will address this post-V1. |
Terraform CLI Version
1.4.6
Terraform Provider Version
0.95.0
Terraform Configuration
Category
category:resource
Object type(s)
No response
Expected Behavior
The network policy attached via the attachment resource gets attached to the user.
Actual Behavior
The user loses the network policy on every 2nd plan/apply.
This is made clear by the plan showing the network_policy being changed even though we don't set it in the resource:
Steps to Reproduce
network_policy
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: