UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

162 lines 7.39 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CockpitAlertManager = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * 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:index/cockpitAlertManager:CockpitAlertManager main fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/cockpitalertmanager.CockpitAlertManager has been deprecated in favor of scaleway.observability/alertmanager.AlertManager */ class CockpitAlertManager extends pulumi.CustomResource { /** * Get an existing CockpitAlertManager 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, id, state, opts) { pulumi.log.warn("CockpitAlertManager is deprecated: scaleway.index/cockpitalertmanager.CockpitAlertManager has been deprecated in favor of scaleway.observability/alertmanager.AlertManager"); return new CockpitAlertManager(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:index/cockpitAlertManager:CockpitAlertManager'; /** * Returns true if the given object is an instance of CockpitAlertManager. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === CockpitAlertManager.__pulumiType; } /** @deprecated scaleway.index/cockpitalertmanager.CockpitAlertManager has been deprecated in favor of scaleway.observability/alertmanager.AlertManager */ constructor(name, argsOrState, opts) { pulumi.log.warn("CockpitAlertManager is deprecated: scaleway.index/cockpitalertmanager.CockpitAlertManager has been deprecated in favor of scaleway.observability/alertmanager.AlertManager"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["alertManagerUrl"] = state?.alertManagerUrl; resourceInputs["contactPoints"] = state?.contactPoints; resourceInputs["enableManagedAlerts"] = state?.enableManagedAlerts; resourceInputs["preconfiguredAlertIds"] = state?.preconfiguredAlertIds; resourceInputs["projectId"] = state?.projectId; resourceInputs["region"] = state?.region; } else { const args = argsOrState; resourceInputs["contactPoints"] = args?.contactPoints; resourceInputs["enableManagedAlerts"] = args?.enableManagedAlerts; resourceInputs["preconfiguredAlertIds"] = args?.preconfiguredAlertIds; resourceInputs["projectId"] = args?.projectId; resourceInputs["region"] = args?.region; resourceInputs["alertManagerUrl"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CockpitAlertManager.__pulumiType, name, resourceInputs, opts); } } exports.CockpitAlertManager = CockpitAlertManager; //# sourceMappingURL=cockpitAlertManager.js.map