snowflake logo
Snowflake v0.26.0, May 30 23

snowflake.Alert

Explore with Pulumi AI

Import

format is database name | schema name | alert name

 $ pulumi import snowflake:index/alert:Alert example 'dbName|schemaName|alertName'

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Snowflake = Pulumi.Snowflake;

return await Deployment.RunAsync(() => 
{
    var alert = new Snowflake.Alert("alert", new()
    {
        Action = "select 1 as c",
        AlertSchedule = new Snowflake.Inputs.AlertAlertScheduleArgs
        {
            Interval = 10,
        },
        Comment = "my alert",
        Condition = "select 1 as c",
        Database = "database",
        Enabled = true,
        Schema = "schema",
        Warehouse = "warehouse",
    });

});
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.NewAlert(ctx, "alert", &snowflake.AlertArgs{
			Action: pulumi.String("select 1 as c"),
			AlertSchedule: &snowflake.AlertAlertScheduleArgs{
				Interval: pulumi.Int(10),
			},
			Comment:   pulumi.String("my alert"),
			Condition: pulumi.String("select 1 as c"),
			Database:  pulumi.String("database"),
			Enabled:   pulumi.Bool(true),
			Schema:    pulumi.String("schema"),
			Warehouse: pulumi.String("warehouse"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.snowflake.Alert;
import com.pulumi.snowflake.AlertArgs;
import com.pulumi.snowflake.inputs.AlertAlertScheduleArgs;
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 alert = new Alert("alert", AlertArgs.builder()        
            .action("select 1 as c")
            .alertSchedule(AlertAlertScheduleArgs.builder()
                .interval(10)
                .build())
            .comment("my alert")
            .condition("select 1 as c")
            .database("database")
            .enabled(true)
            .schema("schema")
            .warehouse("warehouse")
            .build());

    }
}
import pulumi
import pulumi_snowflake as snowflake

alert = snowflake.Alert("alert",
    action="select 1 as c",
    alert_schedule=snowflake.AlertAlertScheduleArgs(
        interval=10,
    ),
    comment="my alert",
    condition="select 1 as c",
    database="database",
    enabled=True,
    schema="schema",
    warehouse="warehouse")
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const alert = new snowflake.Alert("alert", {
    action: "select 1 as c",
    alertSchedule: {
        interval: 10,
    },
    comment: "my alert",
    condition: "select 1 as c",
    database: "database",
    enabled: true,
    schema: "schema",
    warehouse: "warehouse",
});
resources:
  alert:
    type: snowflake:Alert
    properties:
      action: select 1 as c
      alertSchedule:
        interval: 10
      comment: my alert
      condition: select 1 as c
      database: database
      enabled: true
      schema: schema
      warehouse: warehouse

Create Alert Resource

new Alert(name: string, args: AlertArgs, opts?: CustomResourceOptions);
@overload
def Alert(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          action: Optional[str] = None,
          alert_schedule: Optional[AlertAlertScheduleArgs] = None,
          comment: Optional[str] = None,
          condition: Optional[str] = None,
          database: Optional[str] = None,
          enabled: Optional[bool] = None,
          name: Optional[str] = None,
          schema: Optional[str] = None,
          warehouse: Optional[str] = None)
@overload
def Alert(resource_name: str,
          args: AlertArgs,
          opts: Optional[ResourceOptions] = None)
func NewAlert(ctx *Context, name string, args AlertArgs, opts ...ResourceOption) (*Alert, error)
public Alert(string name, AlertArgs args, CustomResourceOptions? opts = null)
public Alert(String name, AlertArgs args)
public Alert(String name, AlertArgs args, CustomResourceOptions options)
type: snowflake:Alert
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

Alert 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 Alert resource accepts the following input properties:

Action string

The SQL statement that should be executed if the condition returns one or more rows.

Condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

Database string

The database in which to create the alert.

Schema string

The schema in which to create the alert.

Warehouse string

The warehouse the alert will use.

AlertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

Comment string

Specifies a comment for the alert.

Enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

Name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

Action string

The SQL statement that should be executed if the condition returns one or more rows.

Condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

Database string

The database in which to create the alert.

Schema string

The schema in which to create the alert.

Warehouse string

The warehouse the alert will use.

AlertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

Comment string

Specifies a comment for the alert.

Enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

Name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

action String

The SQL statement that should be executed if the condition returns one or more rows.

condition String

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database String

The database in which to create the alert.

schema String

The schema in which to create the alert.

warehouse String

The warehouse the alert will use.

alertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment String

Specifies a comment for the alert.

enabled Boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name String

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

action string

The SQL statement that should be executed if the condition returns one or more rows.

condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database string

The database in which to create the alert.

schema string

The schema in which to create the alert.

warehouse string

The warehouse the alert will use.

alertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment string

Specifies a comment for the alert.

enabled boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

action str

The SQL statement that should be executed if the condition returns one or more rows.

condition str

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database str

The database in which to create the alert.

schema str

The schema in which to create the alert.

warehouse str

The warehouse the alert will use.

alert_schedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment str

Specifies a comment for the alert.

enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name str

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

action String

The SQL statement that should be executed if the condition returns one or more rows.

condition String

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database String

The database in which to create the alert.

schema String

The schema in which to create the alert.

warehouse String

The warehouse the alert will use.

alertSchedule Property Map

The schedule for periodically running an alert.

comment String

Specifies a comment for the alert.

enabled Boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name String

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Alert 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 Alert Resource

Get an existing Alert 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?: AlertState, opts?: CustomResourceOptions): Alert
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action: Optional[str] = None,
        alert_schedule: Optional[AlertAlertScheduleArgs] = None,
        comment: Optional[str] = None,
        condition: Optional[str] = None,
        database: Optional[str] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        schema: Optional[str] = None,
        warehouse: Optional[str] = None) -> Alert
func GetAlert(ctx *Context, name string, id IDInput, state *AlertState, opts ...ResourceOption) (*Alert, error)
public static Alert Get(string name, Input<string> id, AlertState? state, CustomResourceOptions? opts = null)
public static Alert get(String name, Output<String> id, AlertState 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:
Action string

The SQL statement that should be executed if the condition returns one or more rows.

AlertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

Comment string

Specifies a comment for the alert.

Condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

Database string

The database in which to create the alert.

Enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

Name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

Schema string

The schema in which to create the alert.

Warehouse string

The warehouse the alert will use.

Action string

The SQL statement that should be executed if the condition returns one or more rows.

AlertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

Comment string

Specifies a comment for the alert.

Condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

Database string

The database in which to create the alert.

Enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

Name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

Schema string

The schema in which to create the alert.

Warehouse string

The warehouse the alert will use.

action String

The SQL statement that should be executed if the condition returns one or more rows.

alertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment String

Specifies a comment for the alert.

condition String

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database String

The database in which to create the alert.

enabled Boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name String

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

schema String

The schema in which to create the alert.

warehouse String

The warehouse the alert will use.

action string

The SQL statement that should be executed if the condition returns one or more rows.

alertSchedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment string

Specifies a comment for the alert.

condition string

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database string

The database in which to create the alert.

enabled boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name string

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

schema string

The schema in which to create the alert.

warehouse string

The warehouse the alert will use.

action str

The SQL statement that should be executed if the condition returns one or more rows.

alert_schedule AlertAlertScheduleArgs

The schedule for periodically running an alert.

comment str

Specifies a comment for the alert.

condition str

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database str

The database in which to create the alert.

enabled bool

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name str

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

schema str

The schema in which to create the alert.

warehouse str

The warehouse the alert will use.

action String

The SQL statement that should be executed if the condition returns one or more rows.

alertSchedule Property Map

The schedule for periodically running an alert.

comment String

Specifies a comment for the alert.

condition String

The SQL statement that represents the condition for the alert. (SELECT, SHOW, CALL)

database String

The database in which to create the alert.

enabled Boolean

Specifies if an alert should be 'started' (enabled) after creation or should remain 'suspended' (default).

name String

Specifies the identifier for the alert; must be unique for the database and schema in which the alert is created.

schema String

The schema in which to create the alert.

warehouse String

The warehouse the alert will use.

Supporting Types

AlertAlertSchedule

Cron AlertAlertScheduleCron

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

Interval int

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

Cron AlertAlertScheduleCron

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

Interval int

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

cron AlertAlertScheduleCron

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

interval Integer

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

cron AlertAlertScheduleCron

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

interval number

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

cron AlertAlertScheduleCron

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

interval int

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

cron Property Map

Specifies the cron expression for the alert. The cron expression must be in the following format: "minute hour day-of-month month day-of-week". The following values are supported: minute: 0-59 hour: 0-23 day-of-month: 1-31 month: 1-12 day-of-week: 0-6 (0 is Sunday)

interval Number

Specifies the interval in minutes for the alert schedule. The interval must be greater than 0 and less than 1440 (24 hours).

AlertAlertScheduleCron

Expression string
TimeZone string
Expression string
TimeZone string
expression String
timeZone String
expression string
timeZone string
expression String
timeZone String

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes

This Pulumi package is based on the snowflake Terraform Provider.