@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
124 lines • 6.13 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.OncallEscalation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* * [Official documentation](https://grafana.com/docs/oncall/latest/escalation-chains-and-routes/)
* * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/escalation_policies/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const _default = new grafana.OncallEscalationChain("default", {}, {
* provider: grafana.oncall,
* });
* const alex = grafana.getOncallUser({
* username: "alex",
* });
* // Notify step
* const exampleNotifyStepOncallEscalation = new grafana.OncallEscalation("exampleNotifyStepOncallEscalation", {
* escalationChainId: _default.id,
* type: "notify_persons",
* personsToNotifies: [alex.then(alex => alex.id)],
* position: 0,
* });
* // Wait step
* const exampleNotifyStepIndex_oncallEscalationOncallEscalation = new grafana.OncallEscalation("exampleNotifyStepIndex/oncallEscalationOncallEscalation", {
* escalationChainId: _default.id,
* type: "wait",
* duration: 300,
* position: 1,
* });
* // Important step
* const exampleNotifyStepGrafanaIndex_oncallEscalationOncallEscalation = new grafana.OncallEscalation("exampleNotifyStepGrafanaIndex/oncallEscalationOncallEscalation", {
* escalationChainId: _default.id,
* type: "notify_persons",
* important: true,
* personsToNotifies: [alex.then(alex => alex.id)],
* position: 0,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/oncallEscalation:OncallEscalation escalation_name {{escalation_id}}
* ```
*/
class OncallEscalation extends pulumi.CustomResource {
/**
* Get an existing OncallEscalation 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 OncallEscalation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of OncallEscalation. 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'] === OncallEscalation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["actionToTrigger"] = state ? state.actionToTrigger : undefined;
resourceInputs["duration"] = state ? state.duration : undefined;
resourceInputs["escalationChainId"] = state ? state.escalationChainId : undefined;
resourceInputs["groupToNotify"] = state ? state.groupToNotify : undefined;
resourceInputs["important"] = state ? state.important : undefined;
resourceInputs["notifyIfTimeFrom"] = state ? state.notifyIfTimeFrom : undefined;
resourceInputs["notifyIfTimeTo"] = state ? state.notifyIfTimeTo : undefined;
resourceInputs["notifyOnCallFromSchedule"] = state ? state.notifyOnCallFromSchedule : undefined;
resourceInputs["personsToNotifies"] = state ? state.personsToNotifies : undefined;
resourceInputs["personsToNotifyNextEachTimes"] = state ? state.personsToNotifyNextEachTimes : undefined;
resourceInputs["position"] = state ? state.position : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.escalationChainId === undefined) && !opts.urn) {
throw new Error("Missing required property 'escalationChainId'");
}
if ((!args || args.position === undefined) && !opts.urn) {
throw new Error("Missing required property 'position'");
}
resourceInputs["actionToTrigger"] = args ? args.actionToTrigger : undefined;
resourceInputs["duration"] = args ? args.duration : undefined;
resourceInputs["escalationChainId"] = args ? args.escalationChainId : undefined;
resourceInputs["groupToNotify"] = args ? args.groupToNotify : undefined;
resourceInputs["important"] = args ? args.important : undefined;
resourceInputs["notifyIfTimeFrom"] = args ? args.notifyIfTimeFrom : undefined;
resourceInputs["notifyIfTimeTo"] = args ? args.notifyIfTimeTo : undefined;
resourceInputs["notifyOnCallFromSchedule"] = args ? args.notifyOnCallFromSchedule : undefined;
resourceInputs["personsToNotifies"] = args ? args.personsToNotifies : undefined;
resourceInputs["personsToNotifyNextEachTimes"] = args ? args.personsToNotifyNextEachTimes : undefined;
resourceInputs["position"] = args ? args.position : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(OncallEscalation.__pulumiType, name, resourceInputs, opts);
}
}
exports.OncallEscalation = OncallEscalation;
/** @internal */
OncallEscalation.__pulumiType = 'grafana:index/oncallEscalation:OncallEscalation';
//# sourceMappingURL=oncallEscalation.js.map