@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
95 lines • 3.81 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.Folder = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/)
* * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/folder/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const testFolderFolder = new grafana.Folder("testFolderFolder", {title: "Terraform Test Folder"});
* const testFolderDashboard = new grafana.Dashboard("testFolderDashboard", {
* folder: testFolderFolder.id,
* configJson: `{
* "title": "Dashboard in folder",
* "uid": "dashboard-in-folder"
* }
* `,
* });
* const testFolderWithUid = new grafana.Folder("testFolderWithUid", {
* uid: "test-folder-uid",
* title: "Terraform Test Folder With UID",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/folder:Folder by_integer_id {{folder_id}}
* ```
*
* ```sh
* $ pulumi import grafana:index/folder:Folder by_uid {{folder_uid}}
* ```
*/
class Folder extends pulumi.CustomResource {
/**
* Get an existing Folder 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 Folder(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Folder. 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'] === Folder.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["preventDestroyIfNotEmpty"] = state ? state.preventDestroyIfNotEmpty : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["preventDestroyIfNotEmpty"] = args ? args.preventDestroyIfNotEmpty : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["uid"] = args ? args.uid : undefined;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Folder.__pulumiType, name, resourceInputs, opts);
}
}
exports.Folder = Folder;
/** @internal */
Folder.__pulumiType = 'grafana:index/folder:Folder';
//# sourceMappingURL=folder.js.map