@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
103 lines • 4.66 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlertManager = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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 the alert manager and configure managed alerts
*
* The following commands allow you to:
*
* - enable the alert manager in a Project named `tfTestProject`
* - enable [managed alerts](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#managed-alerts)
* - set up [contact points](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#contact-points) to receive alert notifications
*
* ```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: "alert1@example.com",
* },
* {
* email: "alert2@example.com",
* },
* ],
* });
* ```
*
* ## Import
*
* This section explains how to import alert managers using the ID of the Project associated with Cockpit.
*
* bash
*
* ```sh
* $ pulumi import scaleway:observability/alertManager:AlertManager main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
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, id, state, opts) {
return new AlertManager(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AlertManager.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alertManagerUrl"] = state ? state.alertManagerUrl : undefined;
resourceInputs["contactPoints"] = state ? state.contactPoints : undefined;
resourceInputs["enableManagedAlerts"] = state ? state.enableManagedAlerts : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
}
else {
const args = argsOrState;
resourceInputs["contactPoints"] = args ? args.contactPoints : undefined;
resourceInputs["enableManagedAlerts"] = args ? args.enableManagedAlerts : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["alertManagerUrl"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/cockpitAlertManager:CockpitAlertManager" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(AlertManager.__pulumiType, name, resourceInputs, opts);
}
}
exports.AlertManager = AlertManager;
/** @internal */
AlertManager.__pulumiType = 'scaleway:observability/alertManager:AlertManager';
//# sourceMappingURL=alertManager.js.map