UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

188 lines 8.65 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * The `scaleway.observability.AlertManager` resource allows you to enable and manage the Scaleway Cockpit [alert manager](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#alert-manager). * * 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) for more information. * * ## Example Usage * * ### Enable preconfigured alerts (Recommended) * * Use preconfigured alerts to monitor your Scaleway resources with ready-to-use alert rules: * * ```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").map(alert => (alert.preconfiguredRuleId))), * contactPoints: [{ * email: "alerts@example.com", * }], * }); * ``` * * ### Enable the alert manager with contact points * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "tf_test_project"}); * const alertManager = new scaleway.observability.AlertManager("alert_manager", { * projectId: project.id, * contactPoints: [ * { * email: "alert1@example.com", * }, * { * email: "alert2@example.com", * }, * ], * }); * ``` * * ### Legacy: Enable managed alerts (Deprecated) * * > **Deprecated:** The `enableManagedAlerts` field is deprecated. Use `preconfiguredAlertIds` instead. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "tf_test_project"}); * const alertManager = new scaleway.observability.AlertManager("alert_manager", { * projectId: project.id, * enableManagedAlerts: true, * contactPoints: [{ * email: "alert@example.com", * }], * }); * ``` * * ## Import * * This section explains how to import alert managers using the ID of the Project associated with Cockpit. * * ```sh * $ pulumi import scaleway:observability/alertManager:AlertManager main fr-par/11111111-1111-1111-1111-111111111111 * ``` */ export declare class AlertManager extends pulumi.CustomResource { /** * Get an existing AlertManager 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?: AlertManagerState, opts?: pulumi.CustomResourceOptions): AlertManager; /** * Returns true if the given object is an instance of AlertManager. 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 AlertManager; /** * The URL of the alert manager. */ readonly alertManagerUrl: pulumi.Output<string>; /** * A list of contact points with email addresses that will receive alerts. Each map should contain a single key `email`. */ readonly contactPoints: pulumi.Output<outputs.observability.AlertManagerContactPoint[] | undefined>; /** * **Deprecated** (Optional, Boolean) Use `preconfiguredAlertIds` instead. This field will be removed in a future version. When set to `true`, it enables *all* preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. * * @deprecated Use 'preconfigured_alert_ids' instead. This field will be removed in a future version. */ readonly enableManagedAlerts: pulumi.Output<boolean>; /** * A set of preconfigured alert rule IDs to enable explicitly. Use the `scaleway.observability.getPreconfiguredAlert` data source to list available alerts. */ readonly preconfiguredAlertIds: pulumi.Output<string[] | undefined>; /** * ) The ID of the Project the Cockpit is associated with. */ readonly projectId: pulumi.Output<string>; /** * ) The region where the [alert manager](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#alert-manager) should be enabled. */ readonly region: pulumi.Output<string | undefined>; /** * Create a AlertManager 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?: AlertManagerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AlertManager resources. */ export interface AlertManagerState { /** * The URL of the alert manager. */ alertManagerUrl?: pulumi.Input<string | undefined>; /** * A list of contact points with email addresses that will receive alerts. Each map should contain a single key `email`. */ contactPoints?: pulumi.Input<pulumi.Input<inputs.observability.AlertManagerContactPoint>[] | undefined>; /** * **Deprecated** (Optional, Boolean) Use `preconfiguredAlertIds` instead. This field will be removed in a future version. When set to `true`, it enables *all* preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. * * @deprecated Use 'preconfigured_alert_ids' instead. This field will be removed in a future version. */ enableManagedAlerts?: pulumi.Input<boolean | undefined>; /** * A set of preconfigured alert rule IDs to enable explicitly. Use the `scaleway.observability.getPreconfiguredAlert` data source to list available alerts. */ preconfiguredAlertIds?: pulumi.Input<pulumi.Input<string>[] | undefined>; /** * ) The ID of the Project the Cockpit is associated with. */ projectId?: pulumi.Input<string | undefined>; /** * ) The region where the [alert manager](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#alert-manager) should be enabled. */ region?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a AlertManager resource. */ export interface AlertManagerArgs { /** * A list of contact points with email addresses that will receive alerts. Each map should contain a single key `email`. */ contactPoints?: pulumi.Input<pulumi.Input<inputs.observability.AlertManagerContactPoint>[] | undefined>; /** * **Deprecated** (Optional, Boolean) Use `preconfiguredAlertIds` instead. This field will be removed in a future version. When set to `true`, it enables *all* preconfigured alerts for the project. You cannot filter or disable individual alerts with this legacy flag. * * @deprecated Use 'preconfigured_alert_ids' instead. This field will be removed in a future version. */ enableManagedAlerts?: pulumi.Input<boolean | undefined>; /** * A set of preconfigured alert rule IDs to enable explicitly. Use the `scaleway.observability.getPreconfiguredAlert` data source to list available alerts. */ preconfiguredAlertIds?: pulumi.Input<pulumi.Input<string>[] | undefined>; /** * ) The ID of the Project the Cockpit is associated with. */ projectId?: pulumi.Input<string | undefined>; /** * ) The region where the [alert manager](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#alert-manager) should be enabled. */ region?: pulumi.Input<string | undefined>; } //# sourceMappingURL=alertManager.d.ts.map