Skip to content

Commit

Permalink
feat: task after dag support (#1342)
Browse files Browse the repository at this point in the history
* task after dag support

* dag for tasks

* dag for tasks

* dag for tasks

* dag for tasks

* dag for tasks

* dag for tasks

* dag for tasks

* dag for tasks

* update task acceptance test

* update task acceptance test

* update task acceptance test

* update dag task

* update dag task

* update dag task

* update dag task

* update dag task

* update dag task

* update dag task

* update dag task

* update dag task
  • Loading branch information
sfc-gh-swinkler authored Nov 4, 2022
1 parent 398aa45 commit a117802
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 375 deletions.
10 changes: 5 additions & 5 deletions docs/resources/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: |-
## Example Usage

```terraform
resource snowflake_task task {
resource "snowflake_task" "task" {
comment = "my task"
database = "db"
Expand All @@ -34,7 +34,7 @@ resource snowflake_task task {
enabled = true
}
resource snowflake_task serverless_task {
resource "snowflake_task" "serverless_task" {
comment = "my serverless task"
database = "db"
Expand All @@ -50,12 +50,12 @@ resource snowflake_task serverless_task {
user_task_timeout_ms = 10000
user_task_managed_initial_warehouse_size = "XSMALL"
after = "preceding_task"
after = [snowflake_task.task.name]
when = "foo AND bar"
enabled = true
}
resource snowflake_task test_task {
resource "snowflake_task" "test_task" {
comment = "task with allow_overlapping_execution"
database = "db"
Expand All @@ -81,7 +81,7 @@ resource snowflake_task test_task {

### Optional

- `after` (String) Specifies the predecessor task in the same database and schema of the current task. When a run of the predecessor task finishes successfully, it triggers this task (after a brief lag). (Conflict with schedule)
- `after` (List of String) Specifies one or more predecessor tasks for the current task. Use this option to create a DAG of tasks or add this task to an existing DAG. A DAG is a series of tasks that starts with a scheduled root task and is linked together by dependencies.
- `allow_overlapping_execution` (Boolean) By default, Snowflake ensures that only one instance of a particular DAG is allowed to run at a time, setting the parameter value to TRUE permits DAG runs to overlap.
- `comment` (String) Specifies a comment for the task.
- `enabled` (Boolean) Specifies if the task should be started (enabled) after creation or should remain suspended (default).
Expand Down
8 changes: 4 additions & 4 deletions examples/resources/snowflake_task/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource snowflake_task task {
resource "snowflake_task" "task" {
comment = "my task"

database = "db"
Expand All @@ -19,7 +19,7 @@ resource snowflake_task task {
enabled = true
}

resource snowflake_task serverless_task {
resource "snowflake_task" "serverless_task" {
comment = "my serverless task"

database = "db"
Expand All @@ -35,12 +35,12 @@ resource snowflake_task serverless_task {

user_task_timeout_ms = 10000
user_task_managed_initial_warehouse_size = "XSMALL"
after = "preceding_task"
after = [snowflake_task.task.name]
when = "foo AND bar"
enabled = true
}

resource snowflake_task test_task {
resource "snowflake_task" "test_task" {
comment = "task with allow_overlapping_execution"

database = "db"
Expand Down
Loading

0 comments on commit a117802

Please sign in to comment.