@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
115 lines • 5.22 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.Probe = 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/testing/synthetic-monitoring/set-up/set-up-private-probes/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = new grafana.syntheticmonitoring.Probe("main", {
* name: "Mount Everest",
* latitude: 27.98606,
* longitude: 86.92262,
* region: "APAC",
* labels: {
* type: "mountain",
* },
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:syntheticMonitoring/probe:Probe name "{{ id }}"
* ```
*
* ```sh
* $ pulumi import grafana:syntheticMonitoring/probe:Probe name "{{ id }}:{{ authToken }}"
* ```
*/
class Probe extends pulumi.CustomResource {
/**
* Get an existing Probe 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 Probe(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Probe. 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'] === Probe.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authToken"] = state ? state.authToken : undefined;
resourceInputs["disableBrowserChecks"] = state ? state.disableBrowserChecks : undefined;
resourceInputs["disableScriptedChecks"] = state ? state.disableScriptedChecks : 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["disableBrowserChecks"] = args ? args.disableBrowserChecks : undefined;
resourceInputs["disableScriptedChecks"] = args ? args.disableScriptedChecks : undefined;
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 aliasOpts = { aliases: [{ type: "grafana:index/syntheticMonitoringProbe:SyntheticMonitoringProbe" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
const secretOpts = { additionalSecretOutputs: ["authToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Probe.__pulumiType, name, resourceInputs, opts);
}
}
exports.Probe = Probe;
/** @internal */
Probe.__pulumiType = 'grafana:syntheticMonitoring/probe:Probe';
//# sourceMappingURL=probe.js.map