@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
108 lines • 4.89 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.SyntheticMonitoringProbe = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Besides the public probes run by Grafana Labs, you can also install your
* own private probes. These are only accessible to you and only write data to
* your Grafana Cloud account. Private probes are instances of the open source
* Grafana Synthetic Monitoring Agent.
*
* * [Official documentation](https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/private-probes/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const main = new grafana.SyntheticMonitoringProbe("main", {
* labels: {
* type: "mountain",
* },
* latitude: 27.98606,
* longitude: 86.92262,
* region: "APAC",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/syntheticMonitoringProbe:SyntheticMonitoringProbe probe {{probe-id}}
* ```
*
* ```sh
* $ pulumi import grafana:index/syntheticMonitoringProbe:SyntheticMonitoringProbe probe {{probe-id}}:{{auth_token}}
* ```
*/
class SyntheticMonitoringProbe extends pulumi.CustomResource {
/**
* Get an existing SyntheticMonitoringProbe 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 SyntheticMonitoringProbe(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SyntheticMonitoringProbe. 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'] === SyntheticMonitoringProbe.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authToken"] = state ? state.authToken : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["latitude"] = state ? state.latitude : undefined;
resourceInputs["longitude"] = state ? state.longitude : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["public"] = state ? state.public : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.latitude === undefined) && !opts.urn) {
throw new Error("Missing required property 'latitude'");
}
if ((!args || args.longitude === undefined) && !opts.urn) {
throw new Error("Missing required property 'longitude'");
}
if ((!args || args.region === undefined) && !opts.urn) {
throw new Error("Missing required property 'region'");
}
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["latitude"] = args ? args.latitude : undefined;
resourceInputs["longitude"] = args ? args.longitude : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["public"] = args ? args.public : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["authToken"] = undefined /*out*/;
resourceInputs["tenantId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["authToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SyntheticMonitoringProbe.__pulumiType, name, resourceInputs, opts);
}
}
exports.SyntheticMonitoringProbe = SyntheticMonitoringProbe;
/** @internal */
SyntheticMonitoringProbe.__pulumiType = 'grafana:index/syntheticMonitoringProbe:SyntheticMonitoringProbe';
//# sourceMappingURL=syntheticMonitoringProbe.js.map