UNPKG

@pulumi/fastly

Version:

A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4

168 lines (167 loc) 6.51 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a Fastly Alert. Alerts send notifications to custom integrations (e.g., Slack channels, PagerDuty, Microsoft Teams and New Relic) when an observed metric either exceeds or falls below a threshold. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fastly from "@pulumi/fastly"; * * const example = new fastly.ServiceVcl("example", {name: "my_vcl_service"}); * const exampleIntegration = new fastly.Integration("example", {name: "my_integration"}); * const exampleAlert = new fastly.Alert("example", { * name: "my_vcl_service errors", * serviceId: example.id, * source: "stats", * metric: "status_5xx", * evaluationStrategy: { * type: "above_threshold", * period: "5m", * threshold: 10, * }, * integrationIds: [exampleIntegration.id], * }); * ``` * * ## Import * * Fastly Alerts can be imported using their ID, e.g. * * ```sh * $ pulumi import fastly:index/alert:Alert example xxxxxxxxxxxxxxxxxxxx * ``` */ export declare class Alert extends pulumi.CustomResource { /** * Get an existing Alert 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<pulumi.ID>, state?: AlertState, opts?: pulumi.CustomResourceOptions): Alert; /** * Returns true if the given object is an instance of Alert. 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 Alert; /** * Additional text that is included in the alert notification. */ readonly description: pulumi.Output<string | undefined>; /** * More filters depending on the source type. */ readonly dimensions: pulumi.Output<outputs.AlertDimensions | undefined>; /** * Criteria on how to alert. */ readonly evaluationStrategy: pulumi.Output<outputs.AlertEvaluationStrategy>; /** * List of integrations used to notify when alert fires. */ readonly integrationIds: pulumi.Output<string[] | undefined>; /** * The metric name to alert on for a specific source: [domains](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical), [origins](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical), or [stats](https://developer.fastly.com/reference/api/metrics-stats/historical-stats). */ readonly metric: pulumi.Output<string>; /** * The name of the alert. */ readonly name: pulumi.Output<string>; /** * The service which the alert monitors. Optional when using `stats` as the `source`. */ readonly serviceId: pulumi.Output<string | undefined>; /** * The source where the metric comes from. One of: `domains`, `origins`, `stats`. */ readonly source: pulumi.Output<string>; /** * Create a Alert 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: AlertArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Alert resources. */ export interface AlertState { /** * Additional text that is included in the alert notification. */ description?: pulumi.Input<string>; /** * More filters depending on the source type. */ dimensions?: pulumi.Input<inputs.AlertDimensions>; /** * Criteria on how to alert. */ evaluationStrategy?: pulumi.Input<inputs.AlertEvaluationStrategy>; /** * List of integrations used to notify when alert fires. */ integrationIds?: pulumi.Input<pulumi.Input<string>[]>; /** * The metric name to alert on for a specific source: [domains](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical), [origins](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical), or [stats](https://developer.fastly.com/reference/api/metrics-stats/historical-stats). */ metric?: pulumi.Input<string>; /** * The name of the alert. */ name?: pulumi.Input<string>; /** * The service which the alert monitors. Optional when using `stats` as the `source`. */ serviceId?: pulumi.Input<string>; /** * The source where the metric comes from. One of: `domains`, `origins`, `stats`. */ source?: pulumi.Input<string>; } /** * The set of arguments for constructing a Alert resource. */ export interface AlertArgs { /** * Additional text that is included in the alert notification. */ description?: pulumi.Input<string>; /** * More filters depending on the source type. */ dimensions?: pulumi.Input<inputs.AlertDimensions>; /** * Criteria on how to alert. */ evaluationStrategy: pulumi.Input<inputs.AlertEvaluationStrategy>; /** * List of integrations used to notify when alert fires. */ integrationIds?: pulumi.Input<pulumi.Input<string>[]>; /** * The metric name to alert on for a specific source: [domains](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical), [origins](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical), or [stats](https://developer.fastly.com/reference/api/metrics-stats/historical-stats). */ metric: pulumi.Input<string>; /** * The name of the alert. */ name?: pulumi.Input<string>; /** * The service which the alert monitors. Optional when using `stats` as the `source`. */ serviceId?: pulumi.Input<string>; /** * The source where the metric comes from. One of: `domains`, `origins`, `stats`. */ source: pulumi.Input<string>; }