UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

201 lines (200 loc) 8 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages Grafana public dashboards. * * **Note:** This resource is available only with Grafana 10.2+. * * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/share-dashboards-panels/shared-dashboards/) * * [HTTP API](https://grafana.com/docs/grafana/next/developers/http_api/dashboard_public/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * // Optional (On-premise, not supported in Grafana Cloud): Create an organization * const myOrg = new grafana.oss.Organization("my_org", {name: "test 1"}); * // Create resources (optional: within the organization) * const myFolder = new grafana.oss.Folder("my_folder", { * orgId: myOrg.orgId, * title: "test Folder", * }); * const testDash = new grafana.oss.Dashboard("test_dash", { * orgId: myOrg.orgId, * folder: myFolder.id, * configJson: JSON.stringify({ * title: "My Terraform Dashboard", * uid: "my-dashboard-uid", * }), * }); * const myPublicDashboard = new grafana.oss.DashboardPublic("my_public_dashboard", { * orgId: myOrg.orgId, * dashboardUid: testDash.uid, * uid: "my-custom-public-uid", * accessToken: "e99e4275da6f410d83760eefa934d8d2", * timeSelectionEnabled: true, * isEnabled: true, * annotationsEnabled: true, * share: "public", * }); * // Optional (On-premise, not supported in Grafana Cloud): Create an organization * const myOrg2 = new grafana.oss.Organization("my_org2", {name: "test 2"}); * const testDash2 = new grafana.oss.Dashboard("test_dash2", { * orgId: myOrg2.orgId, * configJson: JSON.stringify({ * title: "My Terraform Dashboard2", * uid: "my-dashboard-uid2", * }), * }); * const myPublicDashboard2 = new grafana.oss.DashboardPublic("my_public_dashboard2", { * orgId: myOrg2.orgId, * dashboardUid: testDash2.uid, * share: "public", * }); * ``` * * ## Import * * ```sh * $ pulumi import grafana:index/dashboardPublic:DashboardPublic name "{{ dashboardUID }}:{{ publicDashboardUID }}" * ``` * * ```sh * $ pulumi import grafana:index/dashboardPublic:DashboardPublic name "{{ orgID }}:{{ dashboardUID }}:{{ publicDashboardUID }}" * ``` * * @deprecated grafana.index/dashboardpublic.DashboardPublic has been deprecated in favor of grafana.oss/dashboardpublic.DashboardPublic */ export declare class DashboardPublic extends pulumi.CustomResource { /** * Get an existing DashboardPublic 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?: DashboardPublicState, opts?: pulumi.CustomResourceOptions): DashboardPublic; /** * Returns true if the given object is an instance of DashboardPublic. 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 DashboardPublic; /** * A public unique identifier of a public dashboard. This is used to construct its URL. It's automatically generated if not provided when creating a public dashboard. */ readonly accessToken: pulumi.Output<string>; /** * Set to `true` to show annotations. The default value is `false`. */ readonly annotationsEnabled: pulumi.Output<boolean | undefined>; /** * The unique identifier of the original dashboard. */ readonly dashboardUid: pulumi.Output<string>; /** * Set to `true` to enable the public dashboard. The default value is `false`. */ readonly isEnabled: pulumi.Output<boolean | 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 the share mode. The default value is `public`. */ readonly share: pulumi.Output<string | undefined>; /** * Set to `true` to enable the time picker in the public dashboard. The default value is `false`. */ readonly timeSelectionEnabled: pulumi.Output<boolean | undefined>; /** * The unique identifier of a public dashboard. It's automatically generated if not provided when creating a public dashboard. */ readonly uid: pulumi.Output<string>; /** * Create a DashboardPublic 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. */ /** @deprecated grafana.index/dashboardpublic.DashboardPublic has been deprecated in favor of grafana.oss/dashboardpublic.DashboardPublic */ constructor(name: string, args: DashboardPublicArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DashboardPublic resources. */ export interface DashboardPublicState { /** * A public unique identifier of a public dashboard. This is used to construct its URL. It's automatically generated if not provided when creating a public dashboard. */ accessToken?: pulumi.Input<string>; /** * Set to `true` to show annotations. The default value is `false`. */ annotationsEnabled?: pulumi.Input<boolean>; /** * The unique identifier of the original dashboard. */ dashboardUid?: pulumi.Input<string>; /** * Set to `true` to enable the public dashboard. The default value is `false`. */ isEnabled?: pulumi.Input<boolean>; /** * The Organization ID. If not set, the Org ID defined in the provider block will be used. */ orgId?: pulumi.Input<string>; /** * Set the share mode. The default value is `public`. */ share?: pulumi.Input<string>; /** * Set to `true` to enable the time picker in the public dashboard. The default value is `false`. */ timeSelectionEnabled?: pulumi.Input<boolean>; /** * The unique identifier of a public dashboard. It's automatically generated if not provided when creating a public dashboard. */ uid?: pulumi.Input<string>; } /** * The set of arguments for constructing a DashboardPublic resource. */ export interface DashboardPublicArgs { /** * A public unique identifier of a public dashboard. This is used to construct its URL. It's automatically generated if not provided when creating a public dashboard. */ accessToken?: pulumi.Input<string>; /** * Set to `true` to show annotations. The default value is `false`. */ annotationsEnabled?: pulumi.Input<boolean>; /** * The unique identifier of the original dashboard. */ dashboardUid: pulumi.Input<string>; /** * Set to `true` to enable the public dashboard. The default value is `false`. */ isEnabled?: pulumi.Input<boolean>; /** * The Organization ID. If not set, the Org ID defined in the provider block will be used. */ orgId?: pulumi.Input<string>; /** * Set the share mode. The default value is `public`. */ share?: pulumi.Input<string>; /** * Set to `true` to enable the time picker in the public dashboard. The default value is `false`. */ timeSelectionEnabled?: pulumi.Input<boolean>; /** * The unique identifier of a public dashboard. It's automatically generated if not provided when creating a public dashboard. */ uid?: pulumi.Input<string>; }