ROLE assign not working in Snowflake with terraform

Hello Everyone,
I am new in terraform.
In TF file contains ROLE creation, USER creation, and Assign a role to USER when we run that file the first time its create USERS and ROLE successfully and throw an error like that ROLE does not exist
But when we run that file a second time it’s run successfully. So it assigns that role to a particular USER.

I attached the TF file as text.


a.txt (1.7 KB)

Try putting depends_on in each of the database grants
e.g.
resource snowflake_database_grant grant {
depends_on = [snowflake_role.role]
database_name = “testing”

privilege = “USAGE”
roles = [“role2”]
with_grant_option = false
}

1 Like