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

snowflake_grant_privileges_to_role on schema doesn't work #2347

Closed
makos81 opened this issue Jan 12, 2024 · 4 comments
Closed

snowflake_grant_privileges_to_role on schema doesn't work #2347

makos81 opened this issue Jan 12, 2024 · 4 comments
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@makos81
Copy link

makos81 commented Jan 12, 2024

Terraform CLI and Provider Versions

0.82.0

Terraform Configuration

resource "snowflake_schema_grant" "schema_grant" {
  database_name = "TF_DB"
  schema_name   = "TF_SCHEMA"

  privilege = "USAGE"
  roles     = ["TF_ROLE"]

  on_future         = false
  with_grant_option = false
}

Expected Behavior

privilege USAGE will ge granted on schema TF_NAME from DB TF_DB for a role TF_ROLE

Actual Behavior

plan error:

wflake_schema_grant.schema_grant,
│ on main.tf line 190, in resource "snowflake_schema_grant" "schema_grant":
│ 190: on_future = false

│ "on_future": conflicts with schema_name

When I remove on_future then plan shows following errors:

ider "registry.terraform.io/snowflake-labs/snowflake" planned an invalid value for snowflake_schema_grant.schema_grant.enable_multiple_grants: planned value
│ cty.False for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an invalid value for snowflake_schema_grant.schema_grant.on_all: planned value cty.False for a
│ non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an invalid value for snowflake_schema_grant.schema_grant.on_future: planned value cty.False
│ for a non-computed attribute.

So complains in race.

Steps to Reproduce

  1. terraform plan

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@makos81 makos81 added the bug Used to mark issues with provider's incorrect behavior label Jan 12, 2024
@sfc-gh-jcieslak sfc-gh-jcieslak self-assigned this Jan 15, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

@makos81
Hey,
I'm kind of confused because the title mentions snowflake_grant_privileges_to_role, but in the configuration, the snowflake_schema_grant is used, but I'll try to help as those error messages look familiar.
You didn't provide the Terraform CLI version, but If you are using an old one I would bump it to at least (as far as I remember) version 1.1.5. I may not work with the older versions as there were some breaking changes.
If that's not the case, please provide more info (Terraform CLI version, TF configuration that doesn't work for you, stack trace).

@makos81
Copy link
Author

makos81 commented Jan 15, 2024

In fact I tested both snowflake_grant_privileges_to_role and snowflake_schema_grant, both did not work. My TR CLI is 0.15.3. I will upgrade it to latest version and try

@sfc-gh-jcieslak
Copy link
Collaborator

@makos81 Ok, lmk If that helped or not.

@makos81
Copy link
Author

makos81 commented Jan 15, 2024

yes, it helped, thank you !

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

No branches or pull requests

2 participants