Closed javierpe27 closed 13 hours ago
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 CLONE
s properly is one of the topics there. We will return to this topic when we reach this item on the roadmap.
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 https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2321#issuecomment-1880845373, 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 👋 I don't know if saw this, but we added an entry on object cloning to our v1 changes list. We would like to postpone it as there are some other solutions provided by the provider and Terraform and currently we are focusing on essential features for V1.
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? cc: @kamilamarcinekpgs (adding you for additional input if possible, since you had the same feature request)
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