1. Packages
  2. Snowflake
  3. API Docs
  4. Task
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

snowflake.Task

Explore with Pulumi AI

snowflake logo
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const task = new snowflake.Task("task", {
        comment: "my task",
        database: "database",
        schema: "schema",
        warehouse: "warehouse",
        name: "task",
        schedule: "10 MINUTE",
        sqlStatement: "select * from foo;",
        sessionParameters: {
            foo: "bar",
        },
        userTaskTimeoutMs: 10000,
        afters: "preceding_task",
        when: "foo AND bar",
        enabled: true,
    });
    const serverlessTask = new snowflake.Task("serverless_task", {
        comment: "my serverless task",
        database: "db",
        schema: "schema",
        name: "serverless_task",
        schedule: "10 MINUTE",
        sqlStatement: "select * from foo;",
        sessionParameters: {
            foo: "bar",
        },
        userTaskTimeoutMs: 10000,
        userTaskManagedInitialWarehouseSize: "XSMALL",
        afters: [task.name],
        when: "foo AND bar",
        enabled: true,
    });
    const testTask = new snowflake.Task("test_task", {
        comment: "task with allow_overlapping_execution",
        database: "database",
        schema: "schema",
        name: "test_task",
        sqlStatement: "select 1 as c;",
        allowOverlappingExecution: true,
        enabled: true,
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    task = snowflake.Task("task",
        comment="my task",
        database="database",
        schema="schema",
        warehouse="warehouse",
        name="task",
        schedule="10 MINUTE",
        sql_statement="select * from foo;",
        session_parameters={
            "foo": "bar",
        },
        user_task_timeout_ms=10000,
        afters="preceding_task",
        when="foo AND bar",
        enabled=True)
    serverless_task = snowflake.Task("serverless_task",
        comment="my serverless task",
        database="db",
        schema="schema",
        name="serverless_task",
        schedule="10 MINUTE",
        sql_statement="select * from foo;",
        session_parameters={
            "foo": "bar",
        },
        user_task_timeout_ms=10000,
        user_task_managed_initial_warehouse_size="XSMALL",
        afters=[task.name],
        when="foo AND bar",
        enabled=True)
    test_task = snowflake.Task("test_task",
        comment="task with allow_overlapping_execution",
        database="database",
        schema="schema",
        name="test_task",
        sql_statement="select 1 as c;",
        allow_overlapping_execution=True,
        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 {
    		task, err := snowflake.NewTask(ctx, "task", &snowflake.TaskArgs{
    			Comment:      pulumi.String("my task"),
    			Database:     pulumi.String("database"),
    			Schema:       pulumi.String("schema"),
    			Warehouse:    pulumi.String("warehouse"),
    			Name:         pulumi.String("task"),
    			Schedule:     pulumi.String("10 MINUTE"),
    			SqlStatement: pulumi.String("select * from foo;"),
    			SessionParameters: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			UserTaskTimeoutMs: pulumi.Int(10000),
    			Afters:            pulumi.StringArray("preceding_task"),
    			When:              pulumi.String("foo AND bar"),
    			Enabled:           pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.NewTask(ctx, "serverless_task", &snowflake.TaskArgs{
    			Comment:      pulumi.String("my serverless task"),
    			Database:     pulumi.String("db"),
    			Schema:       pulumi.String("schema"),
    			Name:         pulumi.String("serverless_task"),
    			Schedule:     pulumi.String("10 MINUTE"),
    			SqlStatement: pulumi.String("select * from foo;"),
    			SessionParameters: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			UserTaskTimeoutMs:                   pulumi.Int(10000),
    			UserTaskManagedInitialWarehouseSize: pulumi.String("XSMALL"),
    			Afters: pulumi.StringArray{
    				task.Name,
    			},
    			When:    pulumi.String("foo AND bar"),
    			Enabled: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.NewTask(ctx, "test_task", &snowflake.TaskArgs{
    			Comment:                   pulumi.String("task with allow_overlapping_execution"),
    			Database:                  pulumi.String("database"),
    			Schema:                    pulumi.String("schema"),
    			Name:                      pulumi.String("test_task"),
    			SqlStatement:              pulumi.String("select 1 as c;"),
    			AllowOverlappingExecution: pulumi.Bool(true),
    			Enabled:                   pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var task = new Snowflake.Task("task", new()
        {
            Comment = "my task",
            Database = "database",
            Schema = "schema",
            Warehouse = "warehouse",
            Name = "task",
            Schedule = "10 MINUTE",
            SqlStatement = "select * from foo;",
            SessionParameters = 
            {
                { "foo", "bar" },
            },
            UserTaskTimeoutMs = 10000,
            Afters = "preceding_task",
            When = "foo AND bar",
            Enabled = true,
        });
    
        var serverlessTask = new Snowflake.Task("serverless_task", new()
        {
            Comment = "my serverless task",
            Database = "db",
            Schema = "schema",
            Name = "serverless_task",
            Schedule = "10 MINUTE",
            SqlStatement = "select * from foo;",
            SessionParameters = 
            {
                { "foo", "bar" },
            },
            UserTaskTimeoutMs = 10000,
            UserTaskManagedInitialWarehouseSize = "XSMALL",
            Afters = new[]
            {
                task.Name,
            },
            When = "foo AND bar",
            Enabled = true,
        });
    
        var testTask = new Snowflake.Task("test_task", new()
        {
            Comment = "task with allow_overlapping_execution",
            Database = "database",
            Schema = "schema",
            Name = "test_task",
            SqlStatement = "select 1 as c;",
            AllowOverlappingExecution = true,
            Enabled = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.Task;
    import com.pulumi.snowflake.TaskArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var task = new Task("task", TaskArgs.builder()
                .comment("my task")
                .database("database")
                .schema("schema")
                .warehouse("warehouse")
                .name("task")
                .schedule("10 MINUTE")
                .sqlStatement("select * from foo;")
                .sessionParameters(Map.of("foo", "bar"))
                .userTaskTimeoutMs(10000)
                .afters("preceding_task")
                .when("foo AND bar")
                .enabled(true)
                .build());
    
            var serverlessTask = new Task("serverlessTask", TaskArgs.builder()
                .comment("my serverless task")
                .database("db")
                .schema("schema")
                .name("serverless_task")
                .schedule("10 MINUTE")
                .sqlStatement("select * from foo;")
                .sessionParameters(Map.of("foo", "bar"))
                .userTaskTimeoutMs(10000)
                .userTaskManagedInitialWarehouseSize("XSMALL")
                .afters(task.name())
                .when("foo AND bar")
                .enabled(true)
                .build());
    
            var testTask = new Task("testTask", TaskArgs.builder()
                .comment("task with allow_overlapping_execution")
                .database("database")
                .schema("schema")
                .name("test_task")
                .sqlStatement("select 1 as c;")
                .allowOverlappingExecution(true)
                .enabled(true)
                .build());
    
        }
    }
    
    resources:
      task:
        type: snowflake:Task
        properties:
          comment: my task
          database: database
          schema: schema
          warehouse: warehouse
          name: task
          schedule: 10 MINUTE
          sqlStatement: select * from foo;
          sessionParameters:
            foo: bar
          userTaskTimeoutMs: 10000
          afters: preceding_task
          when: foo AND bar
          enabled: true
      serverlessTask:
        type: snowflake:Task
        name: serverless_task
        properties:
          comment: my serverless task
          database: db
          schema: schema
          name: serverless_task
          schedule: 10 MINUTE
          sqlStatement: select * from foo;
          sessionParameters:
            foo: bar
          userTaskTimeoutMs: 10000
          userTaskManagedInitialWarehouseSize: XSMALL
          afters:
            - ${task.name}
          when: foo AND bar
          enabled: true
      testTask:
        type: snowflake:Task
        name: test_task
        properties:
          comment: task with allow_overlapping_execution
          database: database
          schema: schema
          name: test_task
          sqlStatement: select 1 as c;
          allowOverlappingExecution: true
          enabled: true
    

    Create Task Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Task(name: string, args: TaskArgs, opts?: CustomResourceOptions);
    @overload
    def Task(resource_name: str,
             args: TaskArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Task(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             database: Optional[str] = None,
             sql_statement: Optional[str] = None,
             schema: Optional[str] = None,
             enabled: Optional[bool] = None,
             afters: Optional[Sequence[str]] = None,
             error_integration: Optional[str] = None,
             name: Optional[str] = None,
             schedule: Optional[str] = None,
             comment: Optional[str] = None,
             session_parameters: Optional[Mapping[str, str]] = None,
             allow_overlapping_execution: Optional[bool] = None,
             suspend_task_after_num_failures: Optional[int] = None,
             user_task_managed_initial_warehouse_size: Optional[str] = None,
             user_task_timeout_ms: Optional[int] = None,
             warehouse: Optional[str] = None,
             when: Optional[str] = None)
    func NewTask(ctx *Context, name string, args TaskArgs, opts ...ResourceOption) (*Task, error)
    public Task(string name, TaskArgs args, CustomResourceOptions? opts = null)
    public Task(String name, TaskArgs args)
    public Task(String name, TaskArgs args, CustomResourceOptions options)
    
    type: snowflake:Task
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.
    name String
    The unique name of the resource.
    args TaskArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var taskResource = new Snowflake.Task("taskResource", new()
    {
        Database = "string",
        SqlStatement = "string",
        Schema = "string",
        Enabled = false,
        Afters = new[]
        {
            "string",
        },
        ErrorIntegration = "string",
        Name = "string",
        Schedule = "string",
        Comment = "string",
        SessionParameters = 
        {
            { "string", "string" },
        },
        AllowOverlappingExecution = false,
        SuspendTaskAfterNumFailures = 0,
        UserTaskManagedInitialWarehouseSize = "string",
        UserTaskTimeoutMs = 0,
        Warehouse = "string",
        When = "string",
    });
    
    example, err := snowflake.NewTask(ctx, "taskResource", &snowflake.TaskArgs{
    	Database:     pulumi.String("string"),
    	SqlStatement: pulumi.String("string"),
    	Schema:       pulumi.String("string"),
    	Enabled:      pulumi.Bool(false),
    	Afters: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ErrorIntegration: pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	Schedule:         pulumi.String("string"),
    	Comment:          pulumi.String("string"),
    	SessionParameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	AllowOverlappingExecution:           pulumi.Bool(false),
    	SuspendTaskAfterNumFailures:         pulumi.Int(0),
    	UserTaskManagedInitialWarehouseSize: pulumi.String("string"),
    	UserTaskTimeoutMs:                   pulumi.Int(0),
    	Warehouse:                           pulumi.String("string"),
    	When:                                pulumi.String("string"),
    })
    
    var taskResource = new Task("taskResource", TaskArgs.builder()
        .database("string")
        .sqlStatement("string")
        .schema("string")
        .enabled(false)
        .afters("string")
        .errorIntegration("string")
        .name("string")
        .schedule("string")
        .comment("string")
        .sessionParameters(Map.of("string", "string"))
        .allowOverlappingExecution(false)
        .suspendTaskAfterNumFailures(0)
        .userTaskManagedInitialWarehouseSize("string")
        .userTaskTimeoutMs(0)
        .warehouse("string")
        .when("string")
        .build());
    
    task_resource = snowflake.Task("taskResource",
        database="string",
        sql_statement="string",
        schema="string",
        enabled=False,
        afters=["string"],
        error_integration="string",
        name="string",
        schedule="string",
        comment="string",
        session_parameters={
            "string": "string",
        },
        allow_overlapping_execution=False,
        suspend_task_after_num_failures=0,
        user_task_managed_initial_warehouse_size="string",
        user_task_timeout_ms=0,
        warehouse="string",
        when="string")
    
    const taskResource = new snowflake.Task("taskResource", {
        database: "string",
        sqlStatement: "string",
        schema: "string",
        enabled: false,
        afters: ["string"],
        errorIntegration: "string",
        name: "string",
        schedule: "string",
        comment: "string",
        sessionParameters: {
            string: "string",
        },
        allowOverlappingExecution: false,
        suspendTaskAfterNumFailures: 0,
        userTaskManagedInitialWarehouseSize: "string",
        userTaskTimeoutMs: 0,
        warehouse: "string",
        when: "string",
    });
    
    type: snowflake:Task
    properties:
        afters:
            - string
        allowOverlappingExecution: false
        comment: string
        database: string
        enabled: false
        errorIntegration: string
        name: string
        schedule: string
        schema: string
        sessionParameters:
            string: string
        sqlStatement: string
        suspendTaskAfterNumFailures: 0
        userTaskManagedInitialWarehouseSize: string
        userTaskTimeoutMs: 0
        warehouse: string
        when: string
    

    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.
    Afters List<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.
    AllowOverlappingExecution bool
    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 bool
    Specifies if the task should be started (enabled) after creation or should remain suspended (default).
    ErrorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    SessionParameters Dictionary<string, string>
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    SuspendTaskAfterNumFailures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    UserTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    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.
    Afters []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.
    AllowOverlappingExecution bool
    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 bool
    Specifies if the task should be started (enabled) after creation or should remain suspended (default).
    ErrorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    SessionParameters map[string]string
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    SuspendTaskAfterNumFailures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    UserTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    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.
    afters List<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.
    allowOverlappingExecution 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).
    errorIntegration String
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    sessionParameters Map<String,String>
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    suspendTaskAfterNumFailures Integer
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize String
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    userTaskTimeoutMs Integer
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    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.
    afters 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.
    allowOverlappingExecution 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).
    errorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    sessionParameters {[key: string]: string}
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    suspendTaskAfterNumFailures number
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    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.
    afters Sequence[str]
    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 bool
    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 str
    Specifies a comment for the task.
    enabled bool
    Specifies if the task should be started (enabled) after creation or should remain suspended (default).
    error_integration str
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    session_parameters Mapping[str, str]
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    suspend_task_after_num_failures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    user_task_managed_initial_warehouse_size str
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when str
    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.
    afters List<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.
    allowOverlappingExecution 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).
    errorIntegration String
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    sessionParameters Map<String>
    Specifies session parameters to set for the session when the task runs. A task supports all session parameters.
    suspendTaskAfterNumFailures Number
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize String
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when String
    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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,
            afters: Optional[Sequence[str]] = None,
            allow_overlapping_execution: Optional[bool] = None,
            comment: Optional[str] = None,
            database: Optional[str] = None,
            enabled: Optional[bool] = None,
            error_integration: Optional[str] = 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,
            suspend_task_after_num_failures: Optional[int] = None,
            user_task_managed_initial_warehouse_size: 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)
    public static Task get(String name, Output<String> id, TaskState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    Afters List<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.
    AllowOverlappingExecution bool
    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.
    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).
    ErrorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    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.
    SuspendTaskAfterNumFailures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    UserTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    When string
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
    Afters []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.
    AllowOverlappingExecution bool
    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.
    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).
    ErrorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    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.
    SuspendTaskAfterNumFailures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    UserTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    When string
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
    afters List<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.
    allowOverlappingExecution 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.
    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).
    errorIntegration String
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    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.
    suspendTaskAfterNumFailures Integer
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize String
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    userTaskTimeoutMs Integer
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when String
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
    afters 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.
    allowOverlappingExecution 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.
    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).
    errorIntegration string
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    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.
    suspendTaskAfterNumFailures number
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize string
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when string
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
    afters Sequence[str]
    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 bool
    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 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).
    error_integration str
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    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.
    suspend_task_after_num_failures int
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    user_task_managed_initial_warehouse_size str
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when str
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.
    afters List<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.
    allowOverlappingExecution 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.
    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).
    errorIntegration String
    Specifies the name of the notification integration used for error notifications.
    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. (Conflict with after)
    schema String
    The schema in which to create the task.
    sessionParameters Map<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.
    suspendTaskAfterNumFailures Number
    Specifies the number of consecutive failed task runs after which the current task is suspended automatically. The default is 0 (no automatic suspension).
    userTaskManagedInitialWarehouseSize String
    Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowflake ignores this parameter setting. (Conflicts with warehouse)
    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. Omit this parameter to use Snowflake-managed compute resources for runs of this task. (Conflicts with usertaskmanagedinitialwarehouse_size)
    when String
    Specifies a Boolean SQL expression; multiple conditions joined with AND/OR are supported.

    Import

    format is database name | schema name | task name

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi