@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
136 lines • 6.81 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.ContactPoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Grafana Alerting contact points.
*
* * Official documentation
* * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/#contact-points)
*
* This resource requires Grafana 9.1.0 or later.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const myContactPoint = new grafana.alerting.ContactPoint("my_contact_point", {
* name: "My Contact Point",
* emails: [{
* addresses: [
* "one@company.org",
* "two@company.org",
* ],
* message: "{{ len .Alerts.Firing }} firing.",
* subject: "{{ template \"default.title\" .}}",
* singleEmail: true,
* disableResolveMessage: false,
* }],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:alerting/contactPoint:ContactPoint name "{{ name }}"
* ```
*
* ```sh
* $ pulumi import grafana:alerting/contactPoint:ContactPoint name "{{ orgID }}:{{ name }}"
* ```
*/
class ContactPoint extends pulumi.CustomResource {
/**
* Get an existing ContactPoint 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 ContactPoint(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ContactPoint. 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'] === ContactPoint.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alertmanagers"] = state ? state.alertmanagers : undefined;
resourceInputs["dingdings"] = state ? state.dingdings : undefined;
resourceInputs["disableProvenance"] = state ? state.disableProvenance : undefined;
resourceInputs["discords"] = state ? state.discords : undefined;
resourceInputs["emails"] = state ? state.emails : undefined;
resourceInputs["googlechats"] = state ? state.googlechats : undefined;
resourceInputs["kafkas"] = state ? state.kafkas : undefined;
resourceInputs["lines"] = state ? state.lines : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["oncalls"] = state ? state.oncalls : undefined;
resourceInputs["opsgenies"] = state ? state.opsgenies : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["pagerduties"] = state ? state.pagerduties : undefined;
resourceInputs["pushovers"] = state ? state.pushovers : undefined;
resourceInputs["sensugos"] = state ? state.sensugos : undefined;
resourceInputs["slacks"] = state ? state.slacks : undefined;
resourceInputs["sns"] = state ? state.sns : undefined;
resourceInputs["teams"] = state ? state.teams : undefined;
resourceInputs["telegrams"] = state ? state.telegrams : undefined;
resourceInputs["threemas"] = state ? state.threemas : undefined;
resourceInputs["victorops"] = state ? state.victorops : undefined;
resourceInputs["webexes"] = state ? state.webexes : undefined;
resourceInputs["webhooks"] = state ? state.webhooks : undefined;
resourceInputs["wecoms"] = state ? state.wecoms : undefined;
}
else {
const args = argsOrState;
resourceInputs["alertmanagers"] = args ? args.alertmanagers : undefined;
resourceInputs["dingdings"] = args ? args.dingdings : undefined;
resourceInputs["disableProvenance"] = args ? args.disableProvenance : undefined;
resourceInputs["discords"] = args ? args.discords : undefined;
resourceInputs["emails"] = args ? args.emails : undefined;
resourceInputs["googlechats"] = args ? args.googlechats : undefined;
resourceInputs["kafkas"] = args ? args.kafkas : undefined;
resourceInputs["lines"] = args ? args.lines : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["oncalls"] = args ? args.oncalls : undefined;
resourceInputs["opsgenies"] = args ? args.opsgenies : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["pagerduties"] = args ? args.pagerduties : undefined;
resourceInputs["pushovers"] = args ? args.pushovers : undefined;
resourceInputs["sensugos"] = args ? args.sensugos : undefined;
resourceInputs["slacks"] = args ? args.slacks : undefined;
resourceInputs["sns"] = args ? args.sns : undefined;
resourceInputs["teams"] = args ? args.teams : undefined;
resourceInputs["telegrams"] = args ? args.telegrams : undefined;
resourceInputs["threemas"] = args ? args.threemas : undefined;
resourceInputs["victorops"] = args ? args.victorops : undefined;
resourceInputs["webexes"] = args ? args.webexes : undefined;
resourceInputs["webhooks"] = args ? args.webhooks : undefined;
resourceInputs["wecoms"] = args ? args.wecoms : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "grafana:index/contactPoint:ContactPoint" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(ContactPoint.__pulumiType, name, resourceInputs, opts);
}
}
exports.ContactPoint = ContactPoint;
/** @internal */
ContactPoint.__pulumiType = 'grafana:alerting/contactPoint:ContactPoint';
//# sourceMappingURL=contactPoint.js.map