I should be able to migrate the old way of using snowflake_user to the new way of using snowflake_service_user by way of terraform state rm && terraform import, and the end result should be 0 terraform plan diffs, 0 resource recreations, and 0 effect on the deployed resources. The only changes should be entirely within the HCL and the terraform state.
Actual Behavior
# snowflake_service_user.new must be replaced
-/+ resource "snowflake_service_user" "new" {
+ user_type = "<changed externally>" # forces replacement
...
}
Steps to Reproduce
Use HCL similar to what is seen above.
terraform state rm the old resource to delete it from the state to start the migration
terraform import the new resource to import it into state to finish the migration
terraform plan to see the diffs and see that your new resource will be re-created, defeating the purpose of the migration.
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
I see the same behavior when migration from snowflake_user to snowflake_legacy_service_user too.
Using jq to inspect my state file from prior to this migration, I see "user_type": "" as one of the attributes.
Terraform CLI Version
v1.9.1
Terraform Provider Version
v0.98.0
Company Name
No response
Terraform Configuration
Category
category:import
Object type(s)
resource:user
Expected Behavior
I should be able to migrate the old way of using
snowflake_user
to the new way of usingsnowflake_service_user
by way ofterraform state rm && terraform import
, and the end result should be 0terraform plan
diffs, 0 resource recreations, and 0 effect on the deployed resources. The only changes should be entirely within the HCL and the terraform state.Actual Behavior
Steps to Reproduce
terraform state rm
the old resource to delete it from the state to start the migrationterraform import
the new resource to import it into state to finish the migrationterraform plan
to see the diffs and see that your new resource will be re-created, defeating the purpose of the migration.How much impact is this issue causing?
Medium
Logs
No response
Additional Information
I see the same behavior when migration from
snowflake_user
tosnowflake_legacy_service_user
too.Using
jq
to inspect my state file from prior to this migration, I see"user_type": ""
as one of the attributes.https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/3119
Would you like to implement a fix?