UNPKG

@lbrlabs/pulumi-grafana

Version:

A Pulumi package for creating and managing grafana.

80 lines 3.27 kB
"use strict"; // *** 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.MessageTemplate = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages Grafana Alerting message templates. * * * [Official documentation](https://grafana.com/docs/grafana/latest/alerting/manage-notifications/template-notifications/create-notification-templates/) * * [HTTP API](https://grafana.com/docs/grafana/next/developers/http_api/alerting_provisioning/#templates) * * This resource requires Grafana 9.1.0 or later. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@lbrlabs/pulumi-grafana"; * * const myTemplate = new grafana.MessageTemplate("myTemplate", {template: `{{define "My Reusable Template" }} * template content * {{ end }} * `}); * ``` * * ## Import * * ```sh * $ pulumi import grafana:index/messageTemplate:MessageTemplate message_template_name {{message_template_name}} * ``` */ class MessageTemplate extends pulumi.CustomResource { /** * Get an existing MessageTemplate 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 MessageTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MessageTemplate. 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'] === MessageTemplate.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["template"] = state ? state.template : undefined; } else { const args = argsOrState; if ((!args || args.template === undefined) && !opts.urn) { throw new Error("Missing required property 'template'"); } resourceInputs["name"] = args ? args.name : undefined; resourceInputs["template"] = args ? args.template : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MessageTemplate.__pulumiType, name, resourceInputs, opts); } } exports.MessageTemplate = MessageTemplate; /** @internal */ MessageTemplate.__pulumiType = 'grafana:index/messageTemplate:MessageTemplate'; //# sourceMappingURL=messageTemplate.js.map