snowflake.Alert
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";
const alert = new snowflake.Alert("alert", {
database: "database",
schema: "schema",
name: "alert",
warehouse: "warehouse",
alertSchedule: {
interval: 10,
},
condition: "select 1 as c",
action: "select 1 as c",
enabled: true,
comment: "my alert",
});
import pulumi
import pulumi_snowflake as snowflake
alert = snowflake.Alert("alert",
database="database",
schema="schema",
name="alert",
warehouse="warehouse",
alert_schedule=snowflake.AlertAlertScheduleArgs(
interval=10,
),
condition="select 1 as c",
action="select 1 as c",
enabled=True,
comment="my alert")
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{
Database: pulumi.String("database"),
Schema: pulumi.String("schema"),
Name: pulumi.String("alert"),
Warehouse: pulumi.String("warehouse"),
AlertSchedule: &snowflake.AlertAlertScheduleArgs{
Interval: pulumi.Int(10),
},
Condition: pulumi.String("select 1 as c"),
Action: pulumi.String("select 1 as c"),
Enabled: pulumi.Bool(true),
Comment: pulumi.String("my alert"),
})
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 alert = new Snowflake.Alert("alert", new()
{
Database = "database",
Schema = "schema",
Name = "alert",
Warehouse = "warehouse",
AlertSchedule = new Snowflake.Inputs.AlertAlertScheduleArgs
{
Interval = 10,
},
Condition = "select 1 as c",
Action = "select 1 as c",
Enabled = true,
Comment = "my alert",
});
});
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()
.database("database")
.schema("schema")
.name("alert")
.warehouse("warehouse")
.alertSchedule(AlertAlertScheduleArgs.builder()
.interval(10)
.build())
.condition("select 1 as c")
.action("select 1 as c")
.enabled(true)
.comment("my alert")
.build());
}
}
resources:
alert:
type: snowflake:Alert
properties:
database: database
schema: schema
name: alert
warehouse: warehouse
alertSchedule:
interval: 10
condition: select 1 as c
action: select 1 as c
enabled: true
comment: my alert
Create Alert Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Alert(name: string, args: AlertArgs, opts?: CustomResourceOptions);
@overload
def Alert(resource_name: str,
args: AlertArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Alert(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
condition: Optional[str] = None,
database: Optional[str] = None,
schema: Optional[str] = None,
warehouse: Optional[str] = None,
alert_schedule: Optional[AlertAlertScheduleArgs] = None,
comment: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None)
func NewAlert(ctx *Context, name string, args AlertArgs, opts ...ResourceOption) (*Alert, error)
public Alert(string name, AlertArgs args, CustomResourceOptions? opts = null)
type: snowflake:Alert
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 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var alertResource = new Snowflake.Alert("alertResource", new()
{
Action = "string",
Condition = "string",
Database = "string",
Schema = "string",
Warehouse = "string",
AlertSchedule = new Snowflake.Inputs.AlertAlertScheduleArgs
{
Cron = new Snowflake.Inputs.AlertAlertScheduleCronArgs
{
Expression = "string",
TimeZone = "string",
},
Interval = 0,
},
Comment = "string",
Enabled = false,
Name = "string",
});
example, err := snowflake.NewAlert(ctx, "alertResource", &snowflake.AlertArgs{
Action: pulumi.String("string"),
Condition: pulumi.String("string"),
Database: pulumi.String("string"),
Schema: pulumi.String("string"),
Warehouse: pulumi.String("string"),
AlertSchedule: &snowflake.AlertAlertScheduleArgs{
Cron: &snowflake.AlertAlertScheduleCronArgs{
Expression: pulumi.String("string"),
TimeZone: pulumi.String("string"),
},
Interval: pulumi.Int(0),
},
Comment: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var alertResource = new Alert("alertResource", AlertArgs.builder()
.action("string")
.condition("string")
.database("string")
.schema("string")
.warehouse("string")
.alertSchedule(AlertAlertScheduleArgs.builder()
.cron(AlertAlertScheduleCronArgs.builder()
.expression("string")
.timeZone("string")
.build())
.interval(0)
.build())
.comment("string")
.enabled(false)
.name("string")
.build());
alert_resource = snowflake.Alert("alertResource",
action="string",
condition="string",
database="string",
schema="string",
warehouse="string",
alert_schedule=snowflake.AlertAlertScheduleArgs(
cron=snowflake.AlertAlertScheduleCronArgs(
expression="string",
time_zone="string",
),
interval=0,
),
comment="string",
enabled=False,
name="string")
const alertResource = new snowflake.Alert("alertResource", {
action: "string",
condition: "string",
database: "string",
schema: "string",
warehouse: "string",
alertSchedule: {
cron: {
expression: "string",
timeZone: "string",
},
interval: 0,
},
comment: "string",
enabled: false,
name: "string",
});
type: snowflake:Alert
properties:
action: string
alertSchedule:
cron:
expression: string
timeZone: string
interval: 0
comment: string
condition: string
database: string
enabled: false
name: string
schema: string
warehouse: string
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.
- Alert
Schedule AlertAlert Schedule - 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.
- Alert
Schedule AlertAlert Schedule Args - 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.
- alert
Schedule AlertAlert Schedule - 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.
- alert
Schedule AlertAlert Schedule - 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 AlertAlert Schedule Args - 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.
- alert
Schedule 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.
- Action string
- The SQL statement that should be executed if the condition returns one or more rows.
- Alert
Schedule AlertAlert Schedule - 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.
- Alert
Schedule AlertAlert Schedule Args - 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.
- alert
Schedule AlertAlert Schedule - 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.
- alert
Schedule AlertAlert Schedule - 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 AlertAlert Schedule Args - 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.
- alert
Schedule 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, AlertAlertScheduleArgs
- Cron
Alert
Alert Schedule Cron - 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
Alert
Alert Schedule Cron - 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
Alert
Alert Schedule Cron - 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
Alert
Alert Schedule Cron - 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
Alert
Alert Schedule Cron - 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, AlertAlertScheduleCronArgs
- Expression string
- 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)
- Time
Zone string - Specifies the time zone for alert refresh.
- Expression string
- 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)
- Time
Zone string - Specifies the time zone for alert refresh.
- expression String
- 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)
- time
Zone String - Specifies the time zone for alert refresh.
- expression string
- 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)
- time
Zone string - Specifies the time zone for alert refresh.
- expression str
- 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)
- time_
zone str - Specifies the time zone for alert refresh.
- expression String
- 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)
- time
Zone String - Specifies the time zone for alert refresh.
Import
format is database name | schema name | alert name
$ pulumi import snowflake:index/alert:Alert example 'dbName|schemaName|alertName'
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.