published on Wednesday, Apr 29, 2026 by pulumiverse
published on Wednesday, Apr 29, 2026 by pulumiverse
Manages Grafana dashboards using the v2 (Dynamic Dashboards) schema.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const example = new grafana.apps.v2.Dashboard("example", {
metadata: {
uid: "example-dashboard-v2",
},
spec: {
title: "Example Dashboard V2",
json: JSON.stringify({
title: "Example Dashboard V2",
cursorSync: "Off",
elements: {},
layout: {
kind: "GridLayout",
spec: {
items: [],
},
},
links: [],
preload: false,
annotations: [],
variables: [],
timeSettings: {
timezone: "browser",
from: "now-6h",
to: "now",
},
}),
},
});
import pulumi
import json
import pulumiverse_grafana as grafana
example = grafana.apps.v2.Dashboard("example",
metadata={
"uid": "example-dashboard-v2",
},
spec={
"title": "Example Dashboard V2",
"json": json.dumps({
"title": "Example Dashboard V2",
"cursorSync": "Off",
"elements": {},
"layout": {
"kind": "GridLayout",
"spec": {
"items": [],
},
},
"links": [],
"preload": False,
"annotations": [],
"variables": [],
"timeSettings": {
"timezone": "browser",
"from": "now-6h",
"to": "now",
},
}),
})
package main
import (
"encoding/json"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/apps"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"title": "Example Dashboard V2",
"cursorSync": "Off",
"elements": map[string]interface{}{},
"layout": map[string]interface{}{
"kind": "GridLayout",
"spec": map[string]interface{}{
"items": []interface{}{},
},
},
"links": []interface{}{},
"preload": false,
"annotations": []interface{}{},
"variables": []interface{}{},
"timeSettings": map[string]interface{}{
"timezone": "browser",
"from": "now-6h",
"to": "now",
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = apps.NewDashboard(ctx, "example", &apps.DashboardArgs{
Metadata: &v2.DashboardMetadataArgs{
Uid: pulumi.String("example-dashboard-v2"),
},
Spec: &v2.DashboardSpecArgs{
Title: pulumi.String("Example Dashboard V2"),
Json: pulumi.String(pulumi.String(json0)),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var example = new Grafana.Apps.V2.Dashboard("example", new()
{
Metadata = new Grafana.Apps.V2.Inputs.DashboardMetadataArgs
{
Uid = "example-dashboard-v2",
},
Spec = new Grafana.Apps.V2.Inputs.DashboardSpecArgs
{
Title = "Example Dashboard V2",
Json = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["title"] = "Example Dashboard V2",
["cursorSync"] = "Off",
["elements"] = new Dictionary<string, object?>
{
},
["layout"] = new Dictionary<string, object?>
{
["kind"] = "GridLayout",
["spec"] = new Dictionary<string, object?>
{
["items"] = new[]
{
},
},
},
["links"] = new[]
{
},
["preload"] = false,
["annotations"] = new[]
{
},
["variables"] = new[]
{
},
["timeSettings"] = new Dictionary<string, object?>
{
["timezone"] = "browser",
["from"] = "now-6h",
["to"] = "now",
},
}),
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.apps_v2.Dashboard;
import com.pulumi.grafana.apps_v2.DashboardArgs;
import com.pulumi.grafana.apps.inputs.DashboardMetadataArgs;
import com.pulumi.grafana.apps.inputs.DashboardSpecArgs;
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 example = new Dashboard("example", DashboardArgs.builder()
.metadata(DashboardMetadataArgs.builder()
.uid("example-dashboard-v2")
.build())
.spec(DashboardSpecArgs.builder()
.title("Example Dashboard V2")
.json(serializeJson(
jsonObject(
jsonProperty("title", "Example Dashboard V2"),
jsonProperty("cursorSync", "Off"),
jsonProperty("elements", jsonObject(
)),
jsonProperty("layout", jsonObject(
jsonProperty("kind", "GridLayout"),
jsonProperty("spec", jsonObject(
jsonProperty("items", jsonArray(
))
))
)),
jsonProperty("links", jsonArray(
)),
jsonProperty("preload", false),
jsonProperty("annotations", jsonArray(
)),
jsonProperty("variables", jsonArray(
)),
jsonProperty("timeSettings", jsonObject(
jsonProperty("timezone", "browser"),
jsonProperty("from", "now-6h"),
jsonProperty("to", "now")
))
)))
.build())
.build());
}
}
resources:
example:
type: grafana:apps/v2:Dashboard
properties:
metadata:
uid: example-dashboard-v2
spec:
title: Example Dashboard V2
json:
fn::toJSON:
title: Example Dashboard V2
cursorSync: Off
elements: {}
layout:
kind: GridLayout
spec:
items: []
links: []
preload: false
annotations: []
variables: []
timeSettings:
timezone: browser
from: now-6h
to: now
Create Dashboard Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Dashboard(name: string, args?: DashboardArgs, opts?: CustomResourceOptions);@overload
def Dashboard(resource_name: str,
args: Optional[DashboardArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Dashboard(resource_name: str,
opts: Optional[ResourceOptions] = None,
metadata: Optional[DashboardMetadataArgs] = None,
options: Optional[DashboardOptionsArgs] = None,
spec: Optional[DashboardSpecArgs] = None)func NewDashboard(ctx *Context, name string, args *DashboardArgs, opts ...ResourceOption) (*Dashboard, error)public Dashboard(string name, DashboardArgs? args = null, CustomResourceOptions? opts = null)
public Dashboard(String name, DashboardArgs args)
public Dashboard(String name, DashboardArgs args, CustomResourceOptions options)
type: grafana:apps/v2/dashboard:Dashboard
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DashboardArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DashboardArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DashboardArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DashboardArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DashboardArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Dashboard 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 Dashboard resource accepts the following input properties:
- Metadata
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Metadata - The metadata of the resource.
- Options
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Options - Options for applying the resource.
- Spec
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Spec - The spec of the resource.
- Metadata
Dashboard
Metadata Args - The metadata of the resource.
- Options
Dashboard
Options Args - Options for applying the resource.
- Spec
Dashboard
Spec Args - The spec of the resource.
- metadata
Dashboard
Metadata - The metadata of the resource.
- options
Dashboard
Options - Options for applying the resource.
- spec
Dashboard
Spec - The spec of the resource.
- metadata
Dashboard
Metadata - The metadata of the resource.
- options
Dashboard
Options - Options for applying the resource.
- spec
Dashboard
Spec - The spec of the resource.
- metadata
Dashboard
Metadata Args - The metadata of the resource.
- options
Dashboard
Options Args - Options for applying the resource.
- spec
Dashboard
Spec Args - The spec of the resource.
- metadata Property Map
- The metadata of the resource.
- options Property Map
- Options for applying the resource.
- spec Property Map
- The spec of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Dashboard resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Dashboard Resource
Get an existing Dashboard 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?: DashboardState, opts?: CustomResourceOptions): Dashboard@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
metadata: Optional[DashboardMetadataArgs] = None,
options: Optional[DashboardOptionsArgs] = None,
spec: Optional[DashboardSpecArgs] = None) -> Dashboardfunc GetDashboard(ctx *Context, name string, id IDInput, state *DashboardState, opts ...ResourceOption) (*Dashboard, error)public static Dashboard Get(string name, Input<string> id, DashboardState? state, CustomResourceOptions? opts = null)public static Dashboard get(String name, Output<String> id, DashboardState state, CustomResourceOptions options)resources: _: type: grafana:apps/v2/dashboard:Dashboard get: id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Metadata
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Metadata - The metadata of the resource.
- Options
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Options - Options for applying the resource.
- Spec
Pulumiverse.
Grafana. Apps. V2. Inputs. Dashboard Spec - The spec of the resource.
- Metadata
Dashboard
Metadata Args - The metadata of the resource.
- Options
Dashboard
Options Args - Options for applying the resource.
- Spec
Dashboard
Spec Args - The spec of the resource.
- metadata
Dashboard
Metadata - The metadata of the resource.
- options
Dashboard
Options - Options for applying the resource.
- spec
Dashboard
Spec - The spec of the resource.
- metadata
Dashboard
Metadata - The metadata of the resource.
- options
Dashboard
Options - Options for applying the resource.
- spec
Dashboard
Spec - The spec of the resource.
- metadata
Dashboard
Metadata Args - The metadata of the resource.
- options
Dashboard
Options Args - Options for applying the resource.
- spec
Dashboard
Spec Args - The spec of the resource.
- metadata Property Map
- The metadata of the resource.
- options Property Map
- Options for applying the resource.
- spec Property Map
- The spec of the resource.
Supporting Types
DashboardMetadata, DashboardMetadataArgs
- Uid string
- The unique identifier of the resource.
- Annotations Dictionary<string, string>
- Annotations of the resource.
- Folder
Uid string - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- Url string
- The full URL of the resource.
- Uuid string
- The globally unique identifier of a resource, used by the API for tracking.
- Version string
- The version of the resource.
- Uid string
- The unique identifier of the resource.
- Annotations map[string]string
- Annotations of the resource.
- Folder
Uid string - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- Url string
- The full URL of the resource.
- Uuid string
- The globally unique identifier of a resource, used by the API for tracking.
- Version string
- The version of the resource.
- uid String
- The unique identifier of the resource.
- annotations Map<String,String>
- Annotations of the resource.
- folder
Uid String - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- url String
- The full URL of the resource.
- uuid String
- The globally unique identifier of a resource, used by the API for tracking.
- version String
- The version of the resource.
- uid string
- The unique identifier of the resource.
- annotations {[key: string]: string}
- Annotations of the resource.
- folder
Uid string - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- url string
- The full URL of the resource.
- uuid string
- The globally unique identifier of a resource, used by the API for tracking.
- version string
- The version of the resource.
- uid str
- The unique identifier of the resource.
- annotations Mapping[str, str]
- Annotations of the resource.
- folder_
uid str - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- url str
- The full URL of the resource.
- uuid str
- The globally unique identifier of a resource, used by the API for tracking.
- version str
- The version of the resource.
- uid String
- The unique identifier of the resource.
- annotations Map<String>
- Annotations of the resource.
- folder
Uid String - The UID of the folder to save the resource in. For example, it's supported for dashboards and folders. To know if it's supported for the specific resource you're using check the documentation.
- url String
- The full URL of the resource.
- uuid String
- The globally unique identifier of a resource, used by the API for tracking.
- version String
- The version of the resource.
DashboardOptions, DashboardOptionsArgs
- Allow
Ui boolUpdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- Manager
Identity string - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- Overwrite bool
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
- Allow
Ui boolUpdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- Manager
Identity string - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- Overwrite bool
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
- allow
Ui BooleanUpdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- manager
Identity String - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- overwrite Boolean
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
- allow
Ui booleanUpdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- manager
Identity string - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- overwrite boolean
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
- allow_
ui_ boolupdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- manager_
identity str - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- overwrite bool
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
- allow
Ui BooleanUpdates - Set to true to allow editing the resource from the Grafana UI. By default, resources managed by Terraform cannot be edited in the UI. Enabling this option will cause divergence between the Terraform configuration and the resource in Grafana.
- manager
Identity String - Override the identity stamped on this resource's manager metadata. Defaults to "grafana-terraform-provider". Use this to distinguish resources managed by different Pulumi Stacks targeting the same Grafana instance.
- overwrite Boolean
- Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
DashboardSpec, DashboardSpecArgs
- Json string
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- List<string>
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- Title string
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
- Json string
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- []string
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- Title string
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
- json String
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- List<String>
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- title String
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
- json string
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- string[]
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- title string
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
- json str
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- Sequence[str]
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- title str
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
- json String
- The JSON representation of the dashboard v2 spec. Must be the spec object only — not the full Kubernetes envelope. Use: json = jsonencode(jsondecode(file("dashboard.json")).spec)
- List<String>
- The tags of the dashboard. If not set, the tags will be derived from the JSON spec.
- title String
- The title of the dashboard. If not set, the title will be derived from the JSON spec.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafanaTerraform Provider.
published on Wednesday, Apr 29, 2026 by pulumiverse
