-
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]: network policy doesn't seem to be applied correctly to snowflake_user in the first time #3294
Comments
Hi @Mattioli 👋 This happens because in one step Terraform tries to
To perform the migration without detaching the policy, we recommend splitting it into the following steps (following our migration guide):
In the mentioned migration guide, there are links to similar issues and discussions. Please let us know if this helps, or if you still have this problem. |
@sfc-gh-jmichalak thank you for the answer, that makes sense. Just another follow-up question, please: in our production changes we will actually not remove the related Do I need to do something special in this case? In other words, I will simply skip step 2 (using |
In this scenario, I think it's best to:
If you would just skip step 2, and remove the user from the list instead, I think it would still get unassigned. |
Which resource should be imported here? And curious why this import step isn't needed in the first case (where the attachment is actually removed from the config)... |
It's not needed in the first scenario, because |
Got it. Thanks for all the help @sfc-gh-jmichalak! |
Terraform CLI Version
1.7.4
Terraform Provider Version
1.0.0
Company Name
No response
Terraform Configuration
Category
category:resource
Object type(s)
No response
Expected Behavior
I expected the
snowflake_user
network policy to be correctly migrated from 0.94 to 0.95.Actual Behavior
I migrated directly from 0.94 to 1.0.0 and found a issue that I believe might be related from changes from 0.94 to 0.95.
Before, I had a
snowflake_network_policy_attachment
tying a user and a network_policy (GCP
in this case). At the same time, I had aVPN
policy set for the account. When I migrated from 0.94 to 1.0.0, I added thenetwork_policy
field to thesnowflake_user
resource and removed thesnowflake_network_policy_attachment
resource. At the same time, I kept theVPN
policy that is set for the account.When I ran the plan, there was no diff related to the user's network policy. However, after applying, if I run a
plan
with the exact same code, the diff shows that the network policy tied to the user is theVPN
one (the account one) instead of theGCP
one. I believe this happened because the account one took precedence over the user one but the Snowflake docs says it should be the other way.I had to run the
apply
again to fix things. While this is fine in staging, this might be troublesome to our production environment, so I'd like to know if there's anything I can do for the firstapply
to work correctly when doing it in production. Thank you.Steps to Reproduce
plan
still shows changesHow much impact is this issue causing?
Medium
Logs
No response
Additional Information
No response
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: