-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix task related issues (#2479)
Related issues: #2036 #2207 #2346. - (#2207) The reason was the change in parsing the `SHOW TASKS` response for `after` parameter. In earlier versions, the parsing was incorrect for the identifiers containing dot characters. The new one fixed the dot case but Snowflake identifiers surprised us one more time, and the basic case, without any `"` was not supported correctly. - (#2036) There is no way to unset `when` currently in Snowflake. We don't want to always `ForceNew` for when change. For that reason we run forceNew conditionally using `customdiff.ForceNewIfChange`. - (#2346) Waiting for answers but maybe this fix will also solve this issues.
- Loading branch information
1 parent
eb20051
commit 0385650
Showing
12 changed files
with
226 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
examples/resources/snowflake_user_password_policy_attachment/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
resource "snowflake_user" "user" { | ||
name = "USER_NAME" | ||
name = "USER_NAME" | ||
} | ||
resource "snowflake_password_policy" "pp" { | ||
database = "prod" | ||
schema = "security" | ||
name = "default_policy" | ||
database = "prod" | ||
schema = "security" | ||
name = "default_policy" | ||
} | ||
|
||
resource "snowflake_user_password_policy_attachment" "ppa" { | ||
password_policy_database = snowflake_password_policy.pp.database | ||
password_policy_schema = snowflake_password_policy.pp.schema | ||
password_policy_name = snowflake_password_policy.pp.name | ||
user_name = snowflake_user.user.name | ||
password_policy_database = snowflake_password_policy.pp.database | ||
password_policy_schema = snowflake_password_policy.pp.schema | ||
password_policy_name = snowflake_password_policy.pp.name | ||
user_name = snowflake_user.user.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "snowflake_task" "test_task" { | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
warehouse = var.warehouse | ||
sql_statement = "SELECT 1" | ||
enabled = true | ||
schedule = "5 MINUTE" | ||
} |
15 changes: 15 additions & 0 deletions
15
pkg/resources/testdata/TestAcc_Task_issue2036/1/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} | ||
|
||
variable "warehouse" { | ||
type = string | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "snowflake_task" "test_task" { | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
warehouse = var.warehouse | ||
sql_statement = "SELECT 1" | ||
enabled = true | ||
schedule = "5 MINUTE" | ||
when = "TRUE" | ||
} |
15 changes: 15 additions & 0 deletions
15
pkg/resources/testdata/TestAcc_Task_issue2036/2/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} | ||
|
||
variable "warehouse" { | ||
type = string | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "snowflake_task" "root_task" { | ||
name = var.root_name | ||
database = var.database | ||
schema = var.schema | ||
warehouse = var.warehouse | ||
sql_statement = "SELECT 1" | ||
enabled = true | ||
schedule = "5 MINUTE" | ||
} | ||
|
||
resource "snowflake_task" "child_task" { | ||
name = var.child_name | ||
database = snowflake_task.root_task.database | ||
schema = snowflake_task.root_task.schema | ||
warehouse = snowflake_task.root_task.warehouse | ||
sql_statement = "SELECT 1" | ||
enabled = true | ||
after = [snowflake_task.root_task.name] | ||
comment = var.comment | ||
} |
23 changes: 23 additions & 0 deletions
23
pkg/resources/testdata/TestAcc_Task_issue2207/1/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} | ||
|
||
variable "warehouse" { | ||
type = string | ||
} | ||
|
||
variable "root_name" { | ||
type = string | ||
} | ||
|
||
variable "child_name" { | ||
type = string | ||
} | ||
|
||
variable "comment" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters