-
Notifications
You must be signed in to change notification settings - Fork 427
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
Clone database with permissions #2321
Comments
Hey @javierpe27. Thanks for creating the issue. One of the next items on our roadmap is to align the existing resources with the underlying functionalities of Snowflake. Supporting the |
Hi Artur,
Glad to hear you are planning to enhance the cloning functionality. Do you
have an estimated eta for this feature? In the meantime do you have any
advice on how to clone a database with their grants in the current version?
…On Mon, 8 Jan 2024 at 11:44, Artur Sawicki ***@***.***> wrote:
Hey @javierpe27 <https://github.com/javierpe27>. Thanks for creating the
issue.
One of the next items on our roadmap is to align the existing resources
with the underlying functionalities of Snowflake. Supporting the CLONEs
properly is one of the topics there. We will return to this topic when we
reach this item on the roadmap.
—
Reply to this email directly, view it on GitHub
<#2321 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL5JOZE7ANYTYNXPYVBURYTYNPLY5AVCNFSM6AAAAABBOHRK62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQHA2DKMZXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
|
Hey @javierpe27. We have yet to set an estimate we can share. To be clear, we will first discuss how the cloning functionality aligns with the terraform ideology, which objects should support it, etc. We will share the discussions with the community as soon as we get there. Currently, what you can do now, for almost every missing feature is to use the snowflake_unsafe_execute resource. It has some limitations, though. Please be sure to familiarize yourself with the docs before using it. |
Thanks for your help @sfc-gh-asawicki ! |
Hey @javierpe27 👋 Could you give more insight (that we will need in research/discussions after v1) into why cloning is important for you and how is it different from regular for_each with the same configuration on the side of terraform? |
We needed cloning because there was no way to remove the public schema. Our solution was to create manually one empty "model" database, with public schema removed and other desired settings applied, to use it as a template to create all other databases by cloning (tried to mimic SQL Server behavior). I am aware that you are working on the possibility to drop the public schema right after creation now, so we will no longer need cloning. |
Thanks, @kamilamarcinekpgs. It's currently possible to drop them on create (https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/database#drop_public_schema_on_creation). |
Closing due to long inactivity + as mentioned object cloning will be considered in the future. |
Terraform CLI and Provider Versions
Terraform CLI version 1.6.6
Provider version = 0.37.1
Use Cases or Problem Statement
I am trying to create several zero copy clones from an existing database. To do that I am using the resource snowflake_database, specifying in the field "from_database" the database I want to clone from. In addition, I would also like to clone the grants of that database, similar to what snowflake already provides out of the box with COPY GRANTS
Proposal
Could you add a feature to allow copying all the grants from an existing database to another one? This will save us a lot of resources assigning all the roles to the clones again. It could be a new parameter in the snowflake_database resource, or a brand new resource, up to you.
How much impact is this issue causing?
High
Additional Information
No response
The text was updated successfully, but these errors were encountered: