@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
101 lines • 4.79 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.MetricsEndpointScrapeJob = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const test = new grafana.connections.MetricsEndpointScrapeJob("test", {
* stackId: "1",
* name: "my-scrape-job",
* enabled: true,
* authenticationMethod: "basic",
* authenticationBasicUsername: "my-username",
* authenticationBasicPassword: "my-password",
* url: "https://grafana.com/metrics",
* scrapeIntervalSeconds: 120,
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_connections_metrics_endpoint_scrape_job.name "{{ stack_id }}:{{ name }}"
* ```
*/
class MetricsEndpointScrapeJob extends pulumi.CustomResource {
/**
* Get an existing MetricsEndpointScrapeJob 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 MetricsEndpointScrapeJob(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of MetricsEndpointScrapeJob. 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'] === MetricsEndpointScrapeJob.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authenticationBasicPassword"] = state?.authenticationBasicPassword;
resourceInputs["authenticationBasicUsername"] = state?.authenticationBasicUsername;
resourceInputs["authenticationBearerToken"] = state?.authenticationBearerToken;
resourceInputs["authenticationMethod"] = state?.authenticationMethod;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["name"] = state?.name;
resourceInputs["scrapeIntervalSeconds"] = state?.scrapeIntervalSeconds;
resourceInputs["stackId"] = state?.stackId;
resourceInputs["url"] = state?.url;
}
else {
const args = argsOrState;
if (args?.authenticationMethod === undefined && !opts.urn) {
throw new Error("Missing required property 'authenticationMethod'");
}
if (args?.stackId === undefined && !opts.urn) {
throw new Error("Missing required property 'stackId'");
}
if (args?.url === undefined && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["authenticationBasicPassword"] = args?.authenticationBasicPassword ? pulumi.secret(args.authenticationBasicPassword) : undefined;
resourceInputs["authenticationBasicUsername"] = args?.authenticationBasicUsername;
resourceInputs["authenticationBearerToken"] = args?.authenticationBearerToken ? pulumi.secret(args.authenticationBearerToken) : undefined;
resourceInputs["authenticationMethod"] = args?.authenticationMethod;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["name"] = args?.name;
resourceInputs["scrapeIntervalSeconds"] = args?.scrapeIntervalSeconds;
resourceInputs["stackId"] = args?.stackId;
resourceInputs["url"] = args?.url;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["authenticationBasicPassword", "authenticationBearerToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(MetricsEndpointScrapeJob.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetricsEndpointScrapeJob = MetricsEndpointScrapeJob;
/** @internal */
MetricsEndpointScrapeJob.__pulumiType = 'grafana:connections/metricsEndpointScrapeJob:MetricsEndpointScrapeJob';
//# sourceMappingURL=metricsEndpointScrapeJob.js.map