1. Packages
  2. Grafana Cloud
  3. API Docs
  4. LibraryPanel
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.LibraryPanel

Explore with Pulumi AI

Deprecated: grafana.index/librarypanel.LibraryPanel has been deprecated in favor of grafana.oss/librarypanel.LibraryPanel

Manages Grafana library panels.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";

const test = new grafana.oss.LibraryPanel("test", {
    name: "panel",
    modelJson: JSON.stringify({
        gridPos: {
            x: 0,
            y: 0,
            h: 10,
            w: 10,
        },
        title: "panel",
        type: "text",
        version: 0,
    }),
});
Copy
import pulumi
import json
import pulumiverse_grafana as grafana

test = grafana.oss.LibraryPanel("test",
    name="panel",
    model_json=json.dumps({
        "gridPos": {
            "x": 0,
            "y": 0,
            "h": 10,
            "w": 10,
        },
        "title": "panel",
        "type": "text",
        "version": 0,
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"gridPos": map[string]interface{}{
				"x": 0,
				"y": 0,
				"h": 10,
				"w": 10,
			},
			"title":   "panel",
			"type":    "text",
			"version": 0,
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = oss.NewLibraryPanel(ctx, "test", &oss.LibraryPanelArgs{
			Name:      pulumi.String("panel"),
			ModelJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Oss.LibraryPanel("test", new()
    {
        Name = "panel",
        ModelJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["gridPos"] = new Dictionary<string, object?>
            {
                ["x"] = 0,
                ["y"] = 0,
                ["h"] = 10,
                ["w"] = 10,
            },
            ["title"] = "panel",
            ["type"] = "text",
            ["version"] = 0,
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.LibraryPanel;
import com.pulumi.grafana.oss.LibraryPanelArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test = new LibraryPanel("test", LibraryPanelArgs.builder()
            .name("panel")
            .modelJson(serializeJson(
                jsonObject(
                    jsonProperty("gridPos", jsonObject(
                        jsonProperty("x", 0),
                        jsonProperty("y", 0),
                        jsonProperty("h", 10),
                        jsonProperty("w", 10)
                    )),
                    jsonProperty("title", "panel"),
                    jsonProperty("type", "text"),
                    jsonProperty("version", 0)
                )))
            .build());

    }
}
Copy
resources:
  test:
    type: grafana:oss:LibraryPanel
    properties:
      name: panel
      modelJson:
        fn::toJSON:
          gridPos:
            x: 0
            y: 0
            h: 10
            w: 10
          title: panel
          type: text
          version: 0
Copy

Create LibraryPanel Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new LibraryPanel(name: string, args: LibraryPanelArgs, opts?: CustomResourceOptions);
@overload
def LibraryPanel(resource_name: str,
                 args: LibraryPanelArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def LibraryPanel(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 folder_uid: Optional[str] = None,
                 model_json: Optional[str] = None,
                 name: Optional[str] = None,
                 org_id: Optional[str] = None,
                 uid: Optional[str] = None)
func NewLibraryPanel(ctx *Context, name string, args LibraryPanelArgs, opts ...ResourceOption) (*LibraryPanel, error)
public LibraryPanel(string name, LibraryPanelArgs args, CustomResourceOptions? opts = null)
public LibraryPanel(String name, LibraryPanelArgs args)
public LibraryPanel(String name, LibraryPanelArgs args, CustomResourceOptions options)
type: grafana:LibraryPanel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LibraryPanelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LibraryPanelArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LibraryPanelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LibraryPanelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LibraryPanelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

LibraryPanel Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The LibraryPanel resource accepts the following input properties:

ModelJson This property is required. string
The JSON model for the library panel.
FolderUid string
Unique ID (UID) of the folder containing the library panel.
Name string
Name of the library panel.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
Uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
ModelJson This property is required. string
The JSON model for the library panel.
FolderUid string
Unique ID (UID) of the folder containing the library panel.
Name string
Name of the library panel.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
Uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
modelJson This property is required. String
The JSON model for the library panel.
folderUid String
Unique ID (UID) of the folder containing the library panel.
name String
Name of the library panel.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
uid String
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
modelJson This property is required. string
The JSON model for the library panel.
folderUid string
Unique ID (UID) of the folder containing the library panel.
name string
Name of the library panel.
orgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
model_json This property is required. str
The JSON model for the library panel.
folder_uid str
Unique ID (UID) of the folder containing the library panel.
name str
Name of the library panel.
org_id Changes to this property will trigger replacement. str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
uid str
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
modelJson This property is required. String
The JSON model for the library panel.
folderUid String
Unique ID (UID) of the folder containing the library panel.
name String
Name of the library panel.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
uid String
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.

Outputs

All input properties are implicitly available as output properties. Additionally, the LibraryPanel resource produces the following output properties:

Created string
Timestamp when the library panel was created.
DashboardIds List<int>
Numerical IDs of Grafana dashboards containing the library panel.
Description string
Description of the library panel.
FolderName string
Name of the folder containing the library panel.
Id string
The provider-assigned unique ID for this managed resource.
PanelId int
The numeric ID of the library panel computed by Grafana.
Type string
Type of the library panel (eg. text).
Updated string
Timestamp when the library panel was last modified.
Version int
Version of the library panel.
Created string
Timestamp when the library panel was created.
DashboardIds []int
Numerical IDs of Grafana dashboards containing the library panel.
Description string
Description of the library panel.
FolderName string
Name of the folder containing the library panel.
Id string
The provider-assigned unique ID for this managed resource.
PanelId int
The numeric ID of the library panel computed by Grafana.
Type string
Type of the library panel (eg. text).
Updated string
Timestamp when the library panel was last modified.
Version int
Version of the library panel.
created String
Timestamp when the library panel was created.
dashboardIds List<Integer>
Numerical IDs of Grafana dashboards containing the library panel.
description String
Description of the library panel.
folderName String
Name of the folder containing the library panel.
id String
The provider-assigned unique ID for this managed resource.
panelId Integer
The numeric ID of the library panel computed by Grafana.
type String
Type of the library panel (eg. text).
updated String
Timestamp when the library panel was last modified.
version Integer
Version of the library panel.
created string
Timestamp when the library panel was created.
dashboardIds number[]
Numerical IDs of Grafana dashboards containing the library panel.
description string
Description of the library panel.
folderName string
Name of the folder containing the library panel.
id string
The provider-assigned unique ID for this managed resource.
panelId number
The numeric ID of the library panel computed by Grafana.
type string
Type of the library panel (eg. text).
updated string
Timestamp when the library panel was last modified.
version number
Version of the library panel.
created str
Timestamp when the library panel was created.
dashboard_ids Sequence[int]
Numerical IDs of Grafana dashboards containing the library panel.
description str
Description of the library panel.
folder_name str
Name of the folder containing the library panel.
id str
The provider-assigned unique ID for this managed resource.
panel_id int
The numeric ID of the library panel computed by Grafana.
type str
Type of the library panel (eg. text).
updated str
Timestamp when the library panel was last modified.
version int
Version of the library panel.
created String
Timestamp when the library panel was created.
dashboardIds List<Number>
Numerical IDs of Grafana dashboards containing the library panel.
description String
Description of the library panel.
folderName String
Name of the folder containing the library panel.
id String
The provider-assigned unique ID for this managed resource.
panelId Number
The numeric ID of the library panel computed by Grafana.
type String
Type of the library panel (eg. text).
updated String
Timestamp when the library panel was last modified.
version Number
Version of the library panel.

Look up Existing LibraryPanel Resource

Get an existing LibraryPanel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: LibraryPanelState, opts?: CustomResourceOptions): LibraryPanel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created: Optional[str] = None,
        dashboard_ids: Optional[Sequence[int]] = None,
        description: Optional[str] = None,
        folder_name: Optional[str] = None,
        folder_uid: Optional[str] = None,
        model_json: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        panel_id: Optional[int] = None,
        type: Optional[str] = None,
        uid: Optional[str] = None,
        updated: Optional[str] = None,
        version: Optional[int] = None) -> LibraryPanel
func GetLibraryPanel(ctx *Context, name string, id IDInput, state *LibraryPanelState, opts ...ResourceOption) (*LibraryPanel, error)
public static LibraryPanel Get(string name, Input<string> id, LibraryPanelState? state, CustomResourceOptions? opts = null)
public static LibraryPanel get(String name, Output<String> id, LibraryPanelState state, CustomResourceOptions options)
resources:  _:    type: grafana:LibraryPanel    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Created string
Timestamp when the library panel was created.
DashboardIds List<int>
Numerical IDs of Grafana dashboards containing the library panel.
Description string
Description of the library panel.
FolderName string
Name of the folder containing the library panel.
FolderUid string
Unique ID (UID) of the folder containing the library panel.
ModelJson string
The JSON model for the library panel.
Name string
Name of the library panel.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId int
The numeric ID of the library panel computed by Grafana.
Type string
Type of the library panel (eg. text).
Uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
Updated string
Timestamp when the library panel was last modified.
Version int
Version of the library panel.
Created string
Timestamp when the library panel was created.
DashboardIds []int
Numerical IDs of Grafana dashboards containing the library panel.
Description string
Description of the library panel.
FolderName string
Name of the folder containing the library panel.
FolderUid string
Unique ID (UID) of the folder containing the library panel.
ModelJson string
The JSON model for the library panel.
Name string
Name of the library panel.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId int
The numeric ID of the library panel computed by Grafana.
Type string
Type of the library panel (eg. text).
Uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
Updated string
Timestamp when the library panel was last modified.
Version int
Version of the library panel.
created String
Timestamp when the library panel was created.
dashboardIds List<Integer>
Numerical IDs of Grafana dashboards containing the library panel.
description String
Description of the library panel.
folderName String
Name of the folder containing the library panel.
folderUid String
Unique ID (UID) of the folder containing the library panel.
modelJson String
The JSON model for the library panel.
name String
Name of the library panel.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Integer
The numeric ID of the library panel computed by Grafana.
type String
Type of the library panel (eg. text).
uid String
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
updated String
Timestamp when the library panel was last modified.
version Integer
Version of the library panel.
created string
Timestamp when the library panel was created.
dashboardIds number[]
Numerical IDs of Grafana dashboards containing the library panel.
description string
Description of the library panel.
folderName string
Name of the folder containing the library panel.
folderUid string
Unique ID (UID) of the folder containing the library panel.
modelJson string
The JSON model for the library panel.
name string
Name of the library panel.
orgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId number
The numeric ID of the library panel computed by Grafana.
type string
Type of the library panel (eg. text).
uid string
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
updated string
Timestamp when the library panel was last modified.
version number
Version of the library panel.
created str
Timestamp when the library panel was created.
dashboard_ids Sequence[int]
Numerical IDs of Grafana dashboards containing the library panel.
description str
Description of the library panel.
folder_name str
Name of the folder containing the library panel.
folder_uid str
Unique ID (UID) of the folder containing the library panel.
model_json str
The JSON model for the library panel.
name str
Name of the library panel.
org_id Changes to this property will trigger replacement. str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panel_id int
The numeric ID of the library panel computed by Grafana.
type str
Type of the library panel (eg. text).
uid str
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
updated str
Timestamp when the library panel was last modified.
version int
Version of the library panel.
created String
Timestamp when the library panel was created.
dashboardIds List<Number>
Numerical IDs of Grafana dashboards containing the library panel.
description String
Description of the library panel.
folderName String
Name of the folder containing the library panel.
folderUid String
Unique ID (UID) of the folder containing the library panel.
modelJson String
The JSON model for the library panel.
name String
Name of the library panel.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Number
The numeric ID of the library panel computed by Grafana.
type String
Type of the library panel (eg. text).
uid String
The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
updated String
Timestamp when the library panel was last modified.
version Number
Version of the library panel.

Import

$ pulumi import grafana:index/libraryPanel:LibraryPanel name "{{ uid }}"
Copy
$ pulumi import grafana:index/libraryPanel:LibraryPanel name "{{ orgID }}:{{ uid }}"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.