UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

186 lines 6.64 kB
import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Gets information about preconfigured alert rules available in Scaleway Cockpit. * * Preconfigured alerts are ready-to-use alert rules that monitor common metrics for Scaleway services. * You can enable these alerts in your Alert Manager using the `scaleway.observability.AlertManager` resource. * * For more information, refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api). * * ## Example Usage * * ### Basic usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * }); * export const availableAlerts = main.then(main => main.alerts); * ``` * * ### Filter by status * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const enabled = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * ruleStatus: "enabled", * }); * const disabled = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * ruleStatus: "disabled", * }); * ``` * * ### Use with Alert Manager * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "my-observability-project"}); * const main = new scaleway.observability.Cockpit("main", {projectId: project.id}); * const all = scaleway.observability.getPreconfiguredAlertOutput({ * projectId: main.projectId, * }); * const mainAlertManager = new scaleway.observability.AlertManager("main", { * projectId: main.projectId, * preconfiguredAlertIds: all.apply(all => .filter(alert => alert.productName == "instance" && alert.ruleStatus == "disabled").map(alert => (alert.preconfiguredRuleId))), * contactPoints: [{ * email: "alerts@example.com", * }], * }); * ``` */ export declare function getPreconfiguredAlert(args?: GetPreconfiguredAlertArgs, opts?: pulumi.InvokeOptions): Promise<GetPreconfiguredAlertResult>; /** * A collection of arguments for invoking getPreconfiguredAlert. */ export interface GetPreconfiguredAlertArgs { /** * Filter alerts by data source ID. */ dataSourceId?: string; /** * The ID of the project the alerts are associated with. If not provided, the default project configured in the provider is used. */ projectId?: string; /** * The region in which the alerts exist. */ region?: string; /** * Filter alerts by rule status. Valid values are `enabled` or `disabled`. */ ruleStatus?: string; } /** * A collection of values returned by getPreconfiguredAlert. */ export interface GetPreconfiguredAlertResult { /** * List of preconfigured alerts. Each alert contains: */ readonly alerts: outputs.observability.GetPreconfiguredAlertAlert[]; /** * ID of the data source containing the alert rule. */ readonly dataSourceId?: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly projectId: string; readonly region?: string; /** * Status of the alert rule (`enabled`, `disabled`, `enabling`, `disabling`). */ readonly ruleStatus?: string; } /** * Gets information about preconfigured alert rules available in Scaleway Cockpit. * * Preconfigured alerts are ready-to-use alert rules that monitor common metrics for Scaleway services. * You can enable these alerts in your Alert Manager using the `scaleway.observability.AlertManager` resource. * * For more information, refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api). * * ## Example Usage * * ### Basic usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * }); * export const availableAlerts = main.then(main => main.alerts); * ``` * * ### Filter by status * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const enabled = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * ruleStatus: "enabled", * }); * const disabled = scaleway.observability.getPreconfiguredAlert({ * projectId: project.id, * ruleStatus: "disabled", * }); * ``` * * ### Use with Alert Manager * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "my-observability-project"}); * const main = new scaleway.observability.Cockpit("main", {projectId: project.id}); * const all = scaleway.observability.getPreconfiguredAlertOutput({ * projectId: main.projectId, * }); * const mainAlertManager = new scaleway.observability.AlertManager("main", { * projectId: main.projectId, * preconfiguredAlertIds: all.apply(all => .filter(alert => alert.productName == "instance" && alert.ruleStatus == "disabled").map(alert => (alert.preconfiguredRuleId))), * contactPoints: [{ * email: "alerts@example.com", * }], * }); * ``` */ export declare function getPreconfiguredAlertOutput(args?: GetPreconfiguredAlertOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetPreconfiguredAlertResult>; /** * A collection of arguments for invoking getPreconfiguredAlert. */ export interface GetPreconfiguredAlertOutputArgs { /** * Filter alerts by data source ID. */ dataSourceId?: pulumi.Input<string | undefined>; /** * The ID of the project the alerts are associated with. If not provided, the default project configured in the provider is used. */ projectId?: pulumi.Input<string | undefined>; /** * The region in which the alerts exist. */ region?: pulumi.Input<string | undefined>; /** * Filter alerts by rule status. Valid values are `enabled` or `disabled`. */ ruleStatus?: pulumi.Input<string | undefined>; } //# sourceMappingURL=getPreconfiguredAlert.d.ts.map