import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Allows you to define alerting channels for the checks and groups in your account * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as checkly from "@checkly/pulumi"; * * // An Email alert channel * const emailAc = new checkly.AlertChannel("email_ac", { * email: { * address: "john@example.com", * }, * sendRecovery: true, * sendFailure: false, * sendDegraded: true, * sslExpiry: true, * sslExpiryThreshold: 22, * }); * // A SMS alert channel * const smsAc = new checkly.AlertChannel("sms_ac", { * sms: { * name: "john", * number: "+5491100001111", * }, * sendRecovery: true, * sendFailure: true, * }); * // A Slack App alert channel, using the Checkly Slack App * const slackAppAc = new checkly.AlertChannel("slack_app_ac", {slackApp: { * slackChannels: [ * "#checkly-notifications", * "@john", * ], * }}); * // A legacy Slack alert channel, using a Slack webhook URL. * // Deprecated: use the slack_app block instead. * const slackAc = new checkly.AlertChannel("slack_ac", {slack: { * channel: "#checkly-notifications", * url: "https://hooks.slack.com/services/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", * }}); * // An Opsgenie alert channel * const opsgenieAc = new checkly.AlertChannel("opsgenie_ac", {opsgenie: { * name: "opsalerts", * apiKey: "fookey", * region: "fooregion", * priority: "foopriority", * }}); * // A Pagerduty alert channel * const pagerdutyAc = new checkly.AlertChannel("pagerduty_ac", {pagerduty: { * account: "checkly", * serviceKey: "key1", * serviceName: "pdalert", * }}); * // A Webhook alert channel * const webhookAc = new checkly.AlertChannel("webhook_ac", {webhook: { * name: "foo", * method: "get", * template: "footemplate", * url: "https://example.com/foo", * webhookSecret: "foosecret", * }}); * // A Firehydran alert channel integration * const firehydrantAc = new checkly.AlertChannel("firehydrant_ac", {webhook: { * name: "firehydrant", * method: "post", * template: `{ * "event": "{{ALERT_TITLE}}", * "link": "{{RESULT_LINK}}", * "check_id": "{{CHECK_ID}}", * "check_type": "{{CHECK_TYPE}}", * "alert_type": "{{ALERT_TYPE}}", * "started_at": "{{STARTED_AT}}", * "check_result_id": "{{CHECK_RESULT_ID}}" * }, * `, * url: "https://app.firehydrant.io/integrations/alerting/webhooks/2/checkly", * webhookType: "WEBHOOK_FIREHYDRANT", * }}); * // A Rootly alert channel — In-App Routing mode. * // Alerts are sent to Rootly and routed internally via Rootly Alert Routes. * const rootlyInappAc = new checkly.AlertChannel("rootly_inapp_ac", { * webhook: { * name: "Rootly (In-App Routing)", * method: "POST", * url: "https://webhooks.rootly.com/webhooks/incoming/checkly_webhooks", * webhookSecret: "", * webhookType: "WEBHOOK_ROOTLY", * template: `{ * "alert_type": "{{ALERT_TYPE}}", * "check_id": "{{CHECK_ID}}", * "check_result_id": "{{CHECK_RESULT_ID}}", * "check_name": "{{CHECK_NAME}}", * "alert_title": "{{ALERT_TITLE}}", * "started_at": "{{STARTED_AT}}", * "link": "{{RESULT_LINK}}" * } * `, * }, * sendRecovery: true, * sendFailure: true, * }); * // A Rootly alert channel — Direct Routing mode. * // Alerts are routed directly to a specific Rootly target via the URL. * // Type is one of: Service, Group (for Teams), EscalationPolicy, Functionality. * // The target ID can be found in the Rootly UI for the chosen resource. * const rootlyDirectAc = new checkly.AlertChannel("rootly_direct_ac", { * webhook: { * name: "Rootly (Direct Routing)", * method: "POST", * url: "https://webhooks.rootly.com/webhooks/incoming/checkly_webhooks/notify/EscalationPolicy/", * webhookSecret: "", * webhookType: "WEBHOOK_ROOTLY", * template: `{ * "alert_type": "{{ALERT_TYPE}}", * "check_id": "{{CHECK_ID}}", * "check_result_id": "{{CHECK_RESULT_ID}}", * "check_name": "{{CHECK_NAME}}", * "alert_title": "{{ALERT_TITLE}}", * "started_at": "{{STARTED_AT}}", * "link": "{{RESULT_LINK}}" * } * `, * }, * sendRecovery: true, * sendFailure: true, * }); * // Connecting the alert channel to a check * const exampleCheck = new checkly.Check("example_check", { * name: "Example check", * alertChannelSubscriptions: [ * { * channelId: emailAc.id, * activated: true, * }, * { * channelId: smsAc.id, * activated: true, * }, * ], * }); * ``` */ export declare class AlertChannel extends pulumi.CustomResource { /** * Get an existing AlertChannel resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AlertChannelState, opts?: pulumi.CustomResourceOptions): AlertChannel; /** * Returns true if the given object is an instance of AlertChannel. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AlertChannel; readonly call: pulumi.Output; readonly email: pulumi.Output; readonly opsgenie: pulumi.Output; readonly pagerduty: pulumi.Output; /** * (Default `false`) */ readonly sendDegraded: pulumi.Output; /** * (Default `true`) */ readonly sendFailure: pulumi.Output; /** * (Default `true`) */ readonly sendRecovery: pulumi.Output; /** * @deprecated The `slack` block uses the legacy Slack webhook integration and will be removed in a future major release. Use `slackApp` instead. */ readonly slack: pulumi.Output; readonly slackApp: pulumi.Output; readonly sms: pulumi.Output; /** * (Default `false`) */ readonly sslExpiry: pulumi.Output; /** * Value must be between 1 and 30 (Default `30`) */ readonly sslExpiryThreshold: pulumi.Output; readonly webhook: pulumi.Output; /** * Create a AlertChannel resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: AlertChannelArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AlertChannel resources. */ export interface AlertChannelState { call?: pulumi.Input; email?: pulumi.Input; opsgenie?: pulumi.Input; pagerduty?: pulumi.Input; /** * (Default `false`) */ sendDegraded?: pulumi.Input; /** * (Default `true`) */ sendFailure?: pulumi.Input; /** * (Default `true`) */ sendRecovery?: pulumi.Input; /** * @deprecated The `slack` block uses the legacy Slack webhook integration and will be removed in a future major release. Use `slackApp` instead. */ slack?: pulumi.Input; slackApp?: pulumi.Input; sms?: pulumi.Input; /** * (Default `false`) */ sslExpiry?: pulumi.Input; /** * Value must be between 1 and 30 (Default `30`) */ sslExpiryThreshold?: pulumi.Input; webhook?: pulumi.Input; } /** * The set of arguments for constructing a AlertChannel resource. */ export interface AlertChannelArgs { call?: pulumi.Input; email?: pulumi.Input; opsgenie?: pulumi.Input; pagerduty?: pulumi.Input; /** * (Default `false`) */ sendDegraded?: pulumi.Input; /** * (Default `true`) */ sendFailure?: pulumi.Input; /** * (Default `true`) */ sendRecovery?: pulumi.Input; /** * @deprecated The `slack` block uses the legacy Slack webhook integration and will be removed in a future major release. Use `slackApp` instead. */ slack?: pulumi.Input; slackApp?: pulumi.Input; sms?: pulumi.Input; /** * (Default `false`) */ sslExpiry?: pulumi.Input; /** * Value must be between 1 and 30 (Default `30`) */ sslExpiryThreshold?: pulumi.Input; webhook?: pulumi.Input; }