@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
99 lines • 4.1 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 "@pulumiverse/grafana";
*
* const testFolder = new grafana.oss.Folder("test_folder", {title: "Terraform Test Folder"});
* const testFolderDashboard = new grafana.oss.Dashboard("test_folder", {
* folder: testFolder.id,
* configJson: `{
* "title": "Dashboard in folder",
* "uid": "dashboard-in-folder"
* }
* `,
* });
* const testFolderWithUid = new grafana.oss.Folder("test_folder_with_uid", {
* uid: "test-folder-uid",
* title: "Terraform Test Folder With UID",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:oss/folder:Folder name "{{ uid }}"
* ```
*
* ```sh
* $ pulumi import grafana:oss/folder:Folder name "{{ orgID }}:{{ 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["parentFolderUid"] = state ? state.parentFolderUid : 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["parentFolderUid"] = args ? args.parentFolderUid : 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);
const aliasOpts = { aliases: [{ type: "grafana:index/folder:Folder" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(Folder.__pulumiType, name, resourceInputs, opts);
}
}
exports.Folder = Folder;
/** @internal */
Folder.__pulumiType = 'grafana:oss/folder:Folder';
//# sourceMappingURL=folder.js.map