Provider: Snowflake
Provider version: ~0.65.0
Terraform cloud version: 1.3.9
I ran Terraform plan to upgrade to Terraform provider 0.65.0. The plan ran successfully. However, upon running Terraform apply, I got this error: (for SECURITYADMIN, ACCOUNTADMIN and SYSADMIN)
│ Error: 003048 (42501): Role ‘SECURITYADMIN’, which was previously activated in this session, is no longer available to the executing user. Login again to create a new session.
Afterwards, running Terraform plan, results into the following error:
Error: could not retrieve session id err = 390186 (08004): Role ‘SECURITYADMIN’ specified in the connect string is not granted to this user. Contact your local system administrator, or attempt to login with another role, e.g. PUBLIC.
with provider[“Terraform Registry”].security_admin
on provider.tf line 32, in provider “snowflake”:
Provider.tf looks like this:
provider “snowflake” {
alias = “security_admin”
role = “SECURITYADMIN”
account = var.account
region = var.region
username = var.username
private_key = var.private_key
}
I checked that Terraform service account had the ACCOUNTADMIN, SECURITYADMIN and SYSADMIN privileges as per the last plan that ran successfully. I also checked that the users with these roles are setup correctly.
Questions:
- How do I fix this error?
- Do I expect to see the Terraform service account as an user on Snowflake?