@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
112 lines • 3.93 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.CheckAlerts = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages alerts for a check in Grafana Synthetic Monitoring.
*
* * [Official documentation](https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/configure-alerts/configure-per-check-alerts/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = new grafana.syntheticmonitoring.Check("main", {
* job: "Check Alert Test",
* target: "https://grafana.com",
* enabled: true,
* probes: [1],
* labels: {},
* settings: {
* http: {
* ipVersion: "V4",
* method: "GET",
* },
* },
* });
* const mainCheckAlerts = new grafana.syntheticmonitoring.CheckAlerts("main", {
* checkId: main.id,
* alerts: [
* {
* name: "ProbeFailedExecutionsTooHigh",
* threshold: 1,
* period: "15m",
* runbookUrl: "",
* },
* {
* name: "TLSTargetCertificateCloseToExpiring",
* threshold: 14,
* period: "",
* runbookUrl: "",
* },
* {
* name: "HTTPRequestDurationTooHighAvg",
* threshold: 5000,
* period: "10m",
* runbookUrl: "https://wiki.company.com/runbooks/http-duration",
* },
* ],
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_synthetic_monitoring_check_alerts.name "{{ check_id }}"
* ```
*/
class CheckAlerts extends pulumi.CustomResource {
/**
* Get an existing CheckAlerts 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 CheckAlerts(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CheckAlerts. 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'] === CheckAlerts.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alerts"] = state?.alerts;
resourceInputs["checkId"] = state?.checkId;
}
else {
const args = argsOrState;
if (args?.alerts === undefined && !opts.urn) {
throw new Error("Missing required property 'alerts'");
}
if (args?.checkId === undefined && !opts.urn) {
throw new Error("Missing required property 'checkId'");
}
resourceInputs["alerts"] = args?.alerts;
resourceInputs["checkId"] = args?.checkId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CheckAlerts.__pulumiType, name, resourceInputs, opts);
}
}
exports.CheckAlerts = CheckAlerts;
/** @internal */
CheckAlerts.__pulumiType = 'grafana:syntheticMonitoring/checkAlerts:CheckAlerts';
//# sourceMappingURL=checkAlerts.js.map