You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The snowflake_role_grants resource is destroyed and the snowflake_grant_account_role resource is created and in good state in the target snowflake account.
Actual Behavior
The destroy of the snowflake_role_grants resource and the create of the snowflake_grant_account_role start executing at the same time in Snowflake upon apply. The destroy completes after after the create. Due to this timing and lack of sequential flow the resource the end result is the create is as if it never happened.
Steps to Reproduce
Remove snowflake_role_grants resource from .tf file
Add snowflake_grant_account_role resource to .tf file
run terraform plan
run terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
We have thousands of snowflake_role_grants instances that need to be replaced. We don't have a clear understanding what the migration pattern should be for deprecated resources like this. I know I am over simplifying this but it would seem to me that it would work fine if the destroy and create operations were not asynchronous and the destroy finished before create executed.
The text was updated successfully, but these errors were encountered:
Hey hey 👋
Afaik, that's more of a Terraform issue than the provider one, but I already had a similar issue you can look at (here). The result of that conversation was a migration guide we wrote here. It describes how you can migrate from deprecated resources to the new ones with "no downtime" approach, meaning nothing will be destroyed/revoked on the snowflake side. I also suggest automating it with a simple script to e.g. generate import blocks, it should pay off when you have thousands of roles. Removing the deprecated resources and replacing them with new ones in the second terraform apply would also work, but that would revoke any grants from them and would create a downtime until new roles are created.
Hey @sfc-gh-jcieslak, thanks for the reply and the resources this is helpful. It's going to be bit of work for us since we have about 3000 resources that need to be replaced across multiple internal/local modules. Either way, your info confirms one of the approaches I was thinking about after my original post. Thanks again!
Terraform CLI and Provider Versions
Terraform v1.5.5
on windows_amd64
Terraform Configuration
Expected Behavior
The snowflake_role_grants resource is destroyed and the snowflake_grant_account_role resource is created and in good state in the target snowflake account.
Actual Behavior
The destroy of the snowflake_role_grants resource and the create of the snowflake_grant_account_role start executing at the same time in Snowflake upon apply. The destroy completes after after the create. Due to this timing and lack of sequential flow the resource the end result is the create is as if it never happened.
Steps to Reproduce
terraform plan
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
We have thousands of snowflake_role_grants instances that need to be replaced. We don't have a clear understanding what the migration pattern should be for deprecated resources like this. I know I am over simplifying this but it would seem to me that it would work fine if the destroy and create operations were not asynchronous and the destroy finished before create executed.
The text was updated successfully, but these errors were encountered: