Skip to content
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

feat: task after dag support #1342

Merged
merged 21 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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