@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
112 lines • 4.18 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceIncidentRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Service Incident Rule within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.Team("test", {
* name: "example-team",
* description: "This team deals with all the things",
* });
* const testService = new opsgenie.Service("test", {
* name: "example-service",
* teamId: test.id,
* });
* const testServiceIncidentRule = new opsgenie.ServiceIncidentRule("test", {
* serviceId: testService.id,
* incidentRules: [{
* conditionMatchType: "match-any-condition",
* conditions: [
* {
* field: "message",
* not: false,
* operation: "contains",
* expectedValue: "expected1",
* },
* {
* field: "message",
* not: false,
* operation: "contains",
* expectedValue: "expected2",
* },
* ],
* incidentProperties: [{
* message: "This is a test message",
* priority: "P3",
* stakeholderProperties: [{
* message: "Message for stakeholders",
* enable: true,
* }],
* }],
* }],
* });
* ```
*
* ## Import
*
* Service Incident Rule can be imported using the `service_id/service_incident_rule_id`, e.g.
*
* ```sh
* $ pulumi import opsgenie:index/serviceIncidentRule:ServiceIncidentRule this service_id/service_incident_rule_id`
* ```
*/
class ServiceIncidentRule extends pulumi.CustomResource {
/**
* Get an existing ServiceIncidentRule 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 ServiceIncidentRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ServiceIncidentRule. 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'] === ServiceIncidentRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["incidentRules"] = state?.incidentRules;
resourceInputs["serviceId"] = state?.serviceId;
}
else {
const args = argsOrState;
if (args?.incidentRules === undefined && !opts.urn) {
throw new Error("Missing required property 'incidentRules'");
}
if (args?.serviceId === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceId'");
}
resourceInputs["incidentRules"] = args?.incidentRules;
resourceInputs["serviceId"] = args?.serviceId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServiceIncidentRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceIncidentRule = ServiceIncidentRule;
/** @internal */
ServiceIncidentRule.__pulumiType = 'opsgenie:index/serviceIncidentRule:ServiceIncidentRule';
//# sourceMappingURL=serviceIncidentRule.js.map