terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Question: Ownership of database at creation

Open mariuskempf opened this issue 2 years ago • 2 comments

Hi, more a question then a bug or request.

Is there a way I can set ownership of a table created with Terraform? I would like to use a custom-made role to create and own all databases, but I'm failing on finding out how to do that or if even possible.

mariuskempf avatar Jul 13 '22 14:07 mariuskempf

Is this what you're looking for?

sfc-gh-jalin avatar Jul 14 '22 18:07 sfc-gh-jalin

Thanks for your reply! Isn't that read-only, meaning that this is not a parameter which I can set but only read? I found kind of a workaround, which is setting the default role for our CI-Runner user according to our role-hierarchy. It would be still nice, though, if one could set the ownership for a resource in the code base. Would allow distributing ownership across multiple roles. In our setup, everything is now owned by this one role

mariuskempf avatar Jul 18 '22 06:07 mariuskempf

Hey 👋 Closing the issue as it's referring to the deprecated resource and we're not supporting them. Please, try to use the latest provider version with the non-deprecated resources (e.g. snowflake_grant_privileges_to_account_role). If the issue persists on the non-deprecated resource (or the feature is present in Snowflake, but not in the provider), please create a new GitHub issue. The migration guide may help during migration to the latest resources. Here's a list of the latest, non-deprecated, grant resources:

Resources snowflake_grant_privileges_to_database_role snowflake_grant_privileges_to_account_role snowflake_grant_account_role snowflake_grant_database_role snowflake_grant_application_role (coming soon) snowflake_grant_privileges_to_share snowflake_grant_ownership (coming soon) <- This is what will resolve your issue

Data sources snowflake_grants

sfc-gh-jcieslak avatar Apr 04 '24 16:04 sfc-gh-jcieslak