UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

162 lines (161 loc) 6.14 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages Grafana dashboards. * * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/) * * [HTTP API (legacy API, recommended for Grafana 12 or earlier)](https://grafana.com/docs/grafana/v11.6/developers/http_api/dashboard/) * * [HTTP API (new Kubernetes-style API, recommended for Grafana 13 and later)](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.oss.Folder("test", { * title: "My Folder", * uid: "my-folder-uid", * }); * const testDashboard = new grafana.oss.Dashboard("test", { * folder: test.uid, * configJson: JSON.stringify({ * title: "My Dashboard", * uid: "my-dashboard-uid", * }), * }); * ``` * * ## Import * * ```sh * terraform import grafana_dashboard.name "{{ uid }}" * terraform import grafana_dashboard.name "{{ orgID }}:{{ uid }}" * ``` */ 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>; }