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

[Bug]: Documentation of snowflake_grant_ownership misleading: hybrid tables are not treated separately for granting purposes. #3300

Open
1 task
nicolamarangoni opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior resource:grant_ownership Issue connected to the snowflake_grant_ownership resource

Comments

@nicolamarangoni
Copy link

Terraform CLI Version

1.9.2

Terraform Provider Version

1.0.0

Company Name

ProSiebenSat.1

Terraform Configuration

Hello,



Best regards,

Nicola

Category

category:resource

Object type(s)

resource:grant_ownership

Expected Behavior

HYBRID TABLES not included in the list object_type_plural

Actual Behavior

HYBRID TABLES present in the list object_type_plural

Steps to Reproduce

Grant ownership resource with:

  on {
    future {
      object_type_plural = "HYBRID TABLES"
      in_database        = "MY_DATABASE"
    }
  }

How much impact is this issue causing?

Low

Logs

No response

Additional Information

Actually, transferring ownership of tables also transfer ownership of hybrid tables, it seems that hybrid tables are not considered separately for grants.

I think that the documentation of the resource snowflake_grant_ownership in the Terraform provider is misleading: https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/grant_ownership

In the list of object_type_plural, HYBRID TABLES are mentioned. That's why I tried to transfer ownership of hybrid tables, first with terraform, then manually with SQL.

However, the GRANT OWNERSHIP statement created by Terraform doesn't work.

Try:

GRANT OWNERSHIP ON ALL HYBRID TABLES IN DATABASE my_database  TO ROLE my_role;
GRANT OWNERSHIP ON ALL HYBRID TABLES IN SCHEMA my_database.my_schema  TO ROLE my_role;

GRANT OWNERSHIP ON FUTURE HYBRID TABLES IN DATABASE my_database  TO ROLE my_role;
GRANT OWNERSHIP ON FUTURE HYBRID TABLES IN SCHEMA my_database.my_schema  TO ROLE my_role;

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@nicolamarangoni nicolamarangoni added the bug Used to mark issues with provider's incorrect behavior label Dec 17, 2024
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @nicolamarangoni 👋

You're right, granting on HYBRID TABLE or ALL HYBRID TABLES doesn't work in Snowsight, and it seems like TABLE and ALL TABLES should be used instead. We will confirm internally if this is an issue with documentation or in Snowflake itself, as I don't know if it should be supported. We will keep you updated. For now, please use

  on {
    future {
      object_type_plural = "TABLES"
      in_database        = "MY_DATABASE"
    }
  }

@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Dec 17, 2024
@sfc-gh-asawicki sfc-gh-asawicki added the resource:grant_ownership Issue connected to the snowflake_grant_ownership resource label Dec 18, 2024
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 resource:grant_ownership Issue connected to the snowflake_grant_ownership resource
Projects
None yet
Development

No branches or pull requests

3 participants