Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Snowflake

v0.2.1 published on Monday, Sep 27, 2021 by Pulumi

Task

Import

format is database name | schema name | task name

 $ pulumi import snowflake:index/task:Task example 'dbName|schemaName|taskName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var task = new Snowflake.Task("task", new Snowflake.TaskArgs
        {
            Comment = "my task",
            Database = "db",
            Schema = "schema",
            Warehouse = "warehouse",
            Schedule = "10",
            SqlStatement = "select * from foo;",
            SessionParameters = 
            {
                { "foo", "bar" },
            },
            UserTaskTimeoutMs = 10000,
            After = "preceding_task",
            When = "foo AND bar",
            Enabled = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := snowflake.NewTask(ctx, "task", &snowflake.TaskArgs{
			Comment:      pulumi.String("my task"),
			Database:     pulumi.String("db"),
			Schema:       pulumi.String("schema"),
			Warehouse:    pulumi.String("warehouse"),
			Schedule:     pulumi.String("10"),
			SqlStatement: pulumi.String("select * from foo;"),
			SessionParameters: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
			UserTaskTimeoutMs: pulumi.Int(10000),
			After:             pulumi.String("preceding_task"),
			When:              pulumi.String("foo AND bar"),
			Enabled:           pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

task = snowflake.Task("task",
    comment="my task",
    database="db",
    schema="schema",
    warehouse="warehouse",
    schedule="10",
    sql_statement="select * from foo;",
    session_parameters={
        "foo": "bar",
    },
    user_task_timeout_ms=10000,
    after="preceding_task",
    when="foo AND bar",
    enabled=True)
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const task = new snowflake.Task("task", {
    comment: "my task",
    database: "db",
    schema: "schema",
    warehouse: "warehouse",
    schedule: "10",
    sqlStatement: "select * from foo;",
    sessionParameters: {
        foo: "bar",
    },
    userTaskTimeoutMs: 10000,
    after: "preceding_task",
    when: "foo AND bar",
    enabled: true,
});

Create a Task Resource

new Task(name: string, args: TaskArgs, opts?: CustomResourceOptions);
@overload
def Task(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         after: Optional[str] = None,
         comment: Optional[str] = None,
         database: Optional[str] = None,
         enabled: Optional[bool] = None,
         name: Optional[str] = None,
         schedule: Optional[str] = None,
         schema: Optional[str] = None,
         session_parameters: Optional[Mapping[str, str]] = None,
         sql_statement: Optional[str] = None,
         user_task_timeout_ms: Optional[int] = None,
         warehouse: Optional[str] = None,
         when: Optional[str] = None)
@overload
def Task(resource_name: str,
         args: TaskArgs,
         opts: Optional[ResourceOptions] = None)
func NewTask(ctx *Context, name string, args TaskArgs, opts ...ResourceOption) (*Task, error)
public Task(string name, TaskArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TaskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args TaskArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TaskArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TaskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Task Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Task resource accepts the following input properties:

Database string
The database in which to create the task.
Schema string
The schema in which to create the task.
SqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
Warehouse string
The warehouse the task will use.
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).
Comment string
Specifies a comment for the task.
Enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
Name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
Schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
SessionParameters Dictionary<string, string>
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
UserTaskTimeoutMs int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
When string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
Database string
The database in which to create the task.
Schema string
The schema in which to create the task.
SqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
Warehouse string
The warehouse the task will use.
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).
Comment string
Specifies a comment for the task.
Enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
Name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
Schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
SessionParameters map[string]string
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
UserTaskTimeoutMs int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
When string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
database string
The database in which to create the task.
schema string
The schema in which to create the task.
sqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
warehouse string
The warehouse the task will use.
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).
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).
name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
sessionParameters {[key: string]: string}
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
userTaskTimeoutMs number
Specifies the time limit on a single run of the task before it times out (in milliseconds).
when string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
database str
The database in which to create the task.
schema str
The schema in which to create the task.
sql_statement str
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
warehouse str
The warehouse the task will use.
after str
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).
comment str
Specifies a comment for the task.
enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
name str
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
schedule str
The schedule for periodically running the task. This can be a cron or interval in minutes.
session_parameters Mapping[str, str]
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
user_task_timeout_ms int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
when str
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.

Outputs

All input properties are implicitly available as output properties. Additionally, the Task resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Task Resource

Get an existing Task resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TaskState, opts?: CustomResourceOptions): Task
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        after: Optional[str] = None,
        comment: Optional[str] = None,
        database: Optional[str] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        schedule: Optional[str] = None,
        schema: Optional[str] = None,
        session_parameters: Optional[Mapping[str, str]] = None,
        sql_statement: Optional[str] = None,
        user_task_timeout_ms: Optional[int] = None,
        warehouse: Optional[str] = None,
        when: Optional[str] = None) -> Task
func GetTask(ctx *Context, name string, id IDInput, state *TaskState, opts ...ResourceOption) (*Task, error)
public static Task Get(string name, Input<string> id, TaskState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

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).
Comment string
Specifies a comment for the task.
Database string
The database in which to create the task.
Enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
Name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
Schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
Schema string
The schema in which to create the task.
SessionParameters Dictionary<string, string>
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
SqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
UserTaskTimeoutMs int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
Warehouse string
The warehouse the task will use.
When string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
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).
Comment string
Specifies a comment for the task.
Database string
The database in which to create the task.
Enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
Name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
Schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
Schema string
The schema in which to create the task.
SessionParameters map[string]string
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
SqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
UserTaskTimeoutMs int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
Warehouse string
The warehouse the task will use.
When string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
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).
comment string
Specifies a comment for the task.
database string
The database in which to create the task.
enabled boolean
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
name string
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
schedule string
The schedule for periodically running the task. This can be a cron or interval in minutes.
schema string
The schema in which to create the task.
sessionParameters {[key: string]: string}
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
sqlStatement string
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
userTaskTimeoutMs number
Specifies the time limit on a single run of the task before it times out (in milliseconds).
warehouse string
The warehouse the task will use.
when string
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
after str
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).
comment str
Specifies a comment for the task.
database str
The database in which to create the task.
enabled bool
Specifies if the task should be started (enabled) after creation or should remain suspended (default).
name str
Specifies the identifier for the task; must be unique for the database and schema in which the task is created.
schedule str
The schedule for periodically running the task. This can be a cron or interval in minutes.
schema str
The schema in which to create the task.
session_parameters Mapping[str, str]
Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
sql_statement str
Any single SQL statement, or a call to a stored procedure, executed when the task runs.
user_task_timeout_ms int
Specifies the time limit on a single run of the task before it times out (in milliseconds).
warehouse str
The warehouse the task will use.
when str
Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.

Package Details

Repository
https://github.com/pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.