-
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
Add or_replace to task resources #1250
Comments
i am conflicted on this. on the one hand i want to support every feature that the Snowflake API does. On the other hand, this is not a very "Terraform" way of doing things. Terraform does not normally overwrite existing resources, its better to throw an error. One thing that might be a better fix is to set partial state, although this could get complicated as it may require special customizeddiff functions to detect if the resource is partially created. Another possibility is to set the id immediately after creation, and before trying to resume the task. See here: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/pkg/resources/task.go#L495-L518. I would move the line Also, you said that you needed to manually resolve this conflict. Was it not possible to use |
For what it’s worth, the AWS provider actually always overwrites existing resources/configurations. Many people prefer this method because it ensures that if someone edits the resource outside of terraform then terraform will remedy it to its intended state. Implementing a provider this way or not is ultimately up to the provider manager, but I wouldn’t say it’s not a terraform way of doing things. |
Hey @PaulGolabowski @danu165 |
We recently had a failed Terraform Apply due to the plugin timing out. The apply was to create 2 new tasks (a root task and a dependent). We usually fix the timing out issue by simply re-running the job from GitHub Actions. This time, though, we got a Snowflake error saying that the dependent task already existed. The only fix was to suspend the root task and drop the dependent via SYSADMIN.
What we'd like to happen is have the explicit "or_replace" option added to the Task resource so that it can be created as a "CREATE OR REPLACE" command instead of a pure "CREATE". Ideally, this option should exist in every resource type that Snowflake supports "CREATE OR REPLACE" syntax.
An alternative would be an easier way to resolve conflicts like this from within Terraform. Or to find a way to fix this plugin timed out bug.
The text was updated successfully, but these errors were encountered: