@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
155 lines (154 loc) • 5.91 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages Grafana dashboards.
*
* * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/)
* * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fs from "fs";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const metrics = new grafana.Dashboard("metrics", {configJson: fs.readFileSync("grafana-dashboard.json")});
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/dashboard:Dashboard dashboard_name {{dashboard_uid}} # To use the default provider org
* ```
*
* ```sh
* $ pulumi import grafana:index/dashboard:Dashboard dashboard_name {{org_id}}:{{dashboard_uid}} # When "org_id" is set on the resource
* ```
*/
export declare class Dashboard extends pulumi.CustomResource {
/**
* Get an existing Dashboard 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: string, id: pulumi.Input<pulumi.ID>, state?: DashboardState, opts?: pulumi.CustomResourceOptions): Dashboard;
/**
* Returns true if the given object is an instance of Dashboard. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Dashboard;
/**
* The complete dashboard model JSON.
*/
readonly configJson: pulumi.Output<string>;
/**
* The numeric ID of the dashboard computed by Grafana.
*/
readonly dashboardId: pulumi.Output<number>;
/**
* The id or UID of the folder to save the dashboard in.
*/
readonly folder: pulumi.Output<string | undefined>;
/**
* Set a commit message for the version history.
*/
readonly message: pulumi.Output<string | undefined>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
readonly orgId: pulumi.Output<string | undefined>;
/**
* Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
*/
readonly overwrite: pulumi.Output<boolean | undefined>;
/**
* The unique identifier of a dashboard. This is used to construct its URL. It's automatically generated if not provided when creating a dashboard. The uid allows having consistent URLs for accessing dashboards and when syncing dashboards between multiple Grafana installs.
*/
readonly uid: pulumi.Output<string>;
/**
* The full URL of the dashboard.
*/
readonly url: pulumi.Output<string>;
/**
* Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are not lost.
*/
readonly version: pulumi.Output<number>;
/**
* Create a Dashboard resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DashboardArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Dashboard resources.
*/
export interface DashboardState {
/**
* The complete dashboard model JSON.
*/
configJson?: pulumi.Input<string>;
/**
* The numeric ID of the dashboard computed by Grafana.
*/
dashboardId?: pulumi.Input<number>;
/**
* The id or UID of the folder to save the dashboard in.
*/
folder?: pulumi.Input<string>;
/**
* Set a commit message for the version history.
*/
message?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: pulumi.Input<string>;
/**
* Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
*/
overwrite?: pulumi.Input<boolean>;
/**
* The unique identifier of a dashboard. This is used to construct its URL. It's automatically generated if not provided when creating a dashboard. The uid allows having consistent URLs for accessing dashboards and when syncing dashboards between multiple Grafana installs.
*/
uid?: pulumi.Input<string>;
/**
* The full URL of the dashboard.
*/
url?: pulumi.Input<string>;
/**
* Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are not lost.
*/
version?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a Dashboard resource.
*/
export interface DashboardArgs {
/**
* The complete dashboard model JSON.
*/
configJson: pulumi.Input<string>;
/**
* The id or UID of the folder to save the dashboard in.
*/
folder?: pulumi.Input<string>;
/**
* Set a commit message for the version history.
*/
message?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: pulumi.Input<string>;
/**
* Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
*/
overwrite?: pulumi.Input<boolean>;
}