@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
102 lines • 4.03 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.Pipeline = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Grafana Fleet Management pipelines.
*
* Pipelines are always sent to the API with a Terraform pipeline source (SOURCE_TYPE_TERRAFORM) so Fleet Management can show them as Terraform-managed. Use the optional terraformSourceNamespace argument (defaults to the string "default") for a stable namespace per root or workspace.
*
* * [Official documentation](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/)
* * [API documentation](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/api-reference/pipeline-api/)
* * Step-by-step guide
*
* Required access policy scopes:
*
* * fleet-management:read
* * fleet-management:write
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
* import * as std from "@pulumi/std";
*
* const test = new grafana.fleetmanagement.Pipeline("test", {
* name: "my_pipeline",
* contents: std.index.file({
* input: "config.alloy",
* }).result,
* matchers: [
* "collector.os=~\".*\"",
* "env=\"PROD\"",
* ],
* enabled: true,
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_fleet_management_pipeline.name "{{ name }}"
* ```
*/
class Pipeline extends pulumi.CustomResource {
/**
* Get an existing Pipeline 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 Pipeline(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Pipeline. 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'] === Pipeline.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["configType"] = state?.configType;
resourceInputs["contents"] = state?.contents;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["matchers"] = state?.matchers;
resourceInputs["name"] = state?.name;
resourceInputs["terraformSourceNamespace"] = state?.terraformSourceNamespace;
}
else {
const args = argsOrState;
if (args?.contents === undefined && !opts.urn) {
throw new Error("Missing required property 'contents'");
}
resourceInputs["configType"] = args?.configType;
resourceInputs["contents"] = args?.contents;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["matchers"] = args?.matchers;
resourceInputs["name"] = args?.name;
resourceInputs["terraformSourceNamespace"] = args?.terraformSourceNamespace;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Pipeline.__pulumiType, name, resourceInputs, opts);
}
}
exports.Pipeline = Pipeline;
/** @internal */
Pipeline.__pulumiType = 'grafana:fleetManagement/pipeline:Pipeline';
//# sourceMappingURL=pipeline.js.map