From 122e4b31c13c02a4170d1dcdae402d2d7fb99f2a Mon Sep 17 00:00:00 2001 From: Bora Kou Date: Tue, 21 May 2024 09:36:18 -0700 Subject: [PATCH 1/2] Set SUSPEND_TASK_AFTER_NUM_FAILURES parameter to zero on results schema. --- schemas.tf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas.tf b/schemas.tf index dec1ebd..1571282 100644 --- a/schemas.tf +++ b/schemas.tf @@ -38,6 +38,20 @@ resource "snowflake_schema" "results" { name = local.results_schema_name } +resource "snowflake_object_parameter" "results_schema_suspend_task_after_num_failures" { + count = var.create_schemas == true ? 1 : 0 + provider = snowflake.admin_role + + key = "SUSPEND_TASK_AFTER_NUM_FAILURES" + value = "0" + object_type = "SCHEMA" + + object_identifier { + database = local.snowalert_database_name + name = local.results_schema + } +} + locals { results_schema = var.create_schemas == true ? snowflake_schema.results[0].name : local.results_schema_name } From 96150149c420c1668a67e78f088313b93c17f9b0 Mon Sep 17 00:00:00 2001 From: Bora Kou Date: Tue, 21 May 2024 13:27:01 -0700 Subject: [PATCH 2/2] Force setting the SUSPEND_TASK_AFTER_NUM_FAILURES parameter regardless TF create the results schema or not. --- schemas.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/schemas.tf b/schemas.tf index 1571282..dd8d869 100644 --- a/schemas.tf +++ b/schemas.tf @@ -39,7 +39,6 @@ resource "snowflake_schema" "results" { } resource "snowflake_object_parameter" "results_schema_suspend_task_after_num_failures" { - count = var.create_schemas == true ? 1 : 0 provider = snowflake.admin_role key = "SUSPEND_TASK_AFTER_NUM_FAILURES"