Skip to content
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

Error: 5 or 6 fields allowed (using snowflake_role_grants) #922

Closed
alexsanderp opened this issue Mar 14, 2022 · 12 comments · Fixed by #941
Closed

Error: 5 or 6 fields allowed (using snowflake_role_grants) #922

alexsanderp opened this issue Mar 14, 2022 · 12 comments · Fixed by #941
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@alexsanderp
Copy link

Provider Version
0.28.6

Terraform Version
1.1.7

Describe the bug

Error: 5 or 6 fields allowed (using snowflake_role_grants)

Expected behavior

In version 0.27.0 it works normally

Code samples and commands

resource "snowflake_role_grants" "dadosfera" {
  role_name = snowflake_role.dadosfera.name

  users = [
    snowflake_user.dadosfera.name
  ]
}

Additional context

image

@alexsanderp alexsanderp added the bug Used to mark issues with provider's incorrect behavior label Mar 14, 2022
@jiangok-open
Copy link

jiangok-open commented Mar 14, 2022

FYI, 0.28.6 darwin amd64 flavor works fine on my MAC.

0.26.3 darwin amd64 flavor works fine on my MAC but the linux amd64 throws the same error above.

@alexsanderp
Copy link
Author

Here it works on any release below 0.27.0

@daniepett
Copy link
Contributor

There's a fix coming in 0.28.7 from this PR #923

@jaeglee0416
Copy link

See comment: #923 (comment)

I wonder if the fix should have been >= 1 on number of fields (for role grants to other roles).

https://registry.terraform.io/providers/chanzuckerberg/snowflake/latest/docs/resources/role_grants

There is only one "required" field role_name.
We're now running into issues with 4 to 6 fields allowed in ID

@daniepett
Copy link
Contributor

daniepett commented Mar 15, 2022

The original code prior to #824

Allowed a 4 or 5 length pipe delimited ID, because the grant privilege isn’t always included. It now allows 4,5 or 6 values. It seems like role grants is a special resource, should’ve picked that up. I’ll revert the changes to that resource.

@ChrisIsidora
Copy link
Contributor

@daniepett Do you know when will you be squaring this off?

@nickperrott
Copy link

Does anybody know of a work-around for this issue while we wait for the next release?

@nickperrott
Copy link

Answered my own question setting replace_on_changes=["users"] in the ResourceOptions seems to be a good workaround. I am using the provider via Pulumi though, but I guess Terraform has this option also.

@ChrisIsidora
Copy link
Contributor

@nickperrott there is no option like that in terraform

@extdponomarchuk
Copy link

Got the same issue
│ Error: 4 to 6 fields allowed in ID │ │ with snowflake_role_grants.role_grants["QA_SHAREADMIN"], │ on grants.tf line 125, in resource "snowflake_role_grants" "role_grants": │ 125: resource "snowflake_role_grants" "role_grants" {

So, rolled back to version "0.25.36"

@daniepett
Copy link
Contributor

I’ll fix the role grants over the weekend

@ChrisIsidora
Copy link
Contributor

I created a rollback of the changes @daniepett @alldoami

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants