@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
103 lines • 5.47 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.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
* $ pulumi import grafana:connections/metricsEndpointScrapeJob:MetricsEndpointScrapeJob 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, Object.assign(Object.assign({}, 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 ? state.authenticationBasicPassword : undefined;
resourceInputs["authenticationBasicUsername"] = state ? state.authenticationBasicUsername : undefined;
resourceInputs["authenticationBearerToken"] = state ? state.authenticationBearerToken : undefined;
resourceInputs["authenticationMethod"] = state ? state.authenticationMethod : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["scrapeIntervalSeconds"] = state ? state.scrapeIntervalSeconds : undefined;
resourceInputs["stackId"] = state ? state.stackId : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.authenticationMethod === undefined) && !opts.urn) {
throw new Error("Missing required property 'authenticationMethod'");
}
if ((!args || args.stackId === undefined) && !opts.urn) {
throw new Error("Missing required property 'stackId'");
}
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["authenticationBasicPassword"] = (args === null || args === void 0 ? void 0 : args.authenticationBasicPassword) ? pulumi.secret(args.authenticationBasicPassword) : undefined;
resourceInputs["authenticationBasicUsername"] = args ? args.authenticationBasicUsername : undefined;
resourceInputs["authenticationBearerToken"] = (args === null || args === void 0 ? void 0 : args.authenticationBearerToken) ? pulumi.secret(args.authenticationBearerToken) : undefined;
resourceInputs["authenticationMethod"] = args ? args.authenticationMethod : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["scrapeIntervalSeconds"] = args ? args.scrapeIntervalSeconds : undefined;
resourceInputs["stackId"] = args ? args.stackId : undefined;
resourceInputs["url"] = args ? args.url : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "grafana:index/connectionsMetricsEndpointScrapeJob:ConnectionsMetricsEndpointScrapeJob" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
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