grafana.oss.Dashboard
Explore with Pulumi AI
Manages Grafana dashboards.
Example Usage
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 pulumi
import json
import pulumiverse_grafana as grafana
test = grafana.oss.Folder("test",
title="My Folder",
uid="my-folder-uid")
test_dashboard = grafana.oss.Dashboard("test",
folder=test.uid,
config_json=json.dumps({
"title": "My Dashboard",
"uid": "my-dashboard-uid",
}))
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 {
test, err := oss.NewFolder(ctx, "test", &oss.FolderArgs{
Title: pulumi.String("My Folder"),
Uid: pulumi.String("my-folder-uid"),
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"title": "My Dashboard",
"uid": "my-dashboard-uid",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = oss.NewDashboard(ctx, "test", &oss.DashboardArgs{
Folder: test.Uid,
ConfigJson: 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 test = new Grafana.Oss.Folder("test", new()
{
Title = "My Folder",
Uid = "my-folder-uid",
});
var testDashboard = new Grafana.Oss.Dashboard("test", new()
{
Folder = test.Uid,
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["title"] = "My Dashboard",
["uid"] = "my-dashboard-uid",
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.Folder;
import com.pulumi.grafana.oss.FolderArgs;
import com.pulumi.grafana.oss.Dashboard;
import com.pulumi.grafana.oss.DashboardArgs;
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 Folder("test", FolderArgs.builder()
.title("My Folder")
.uid("my-folder-uid")
.build());
var testDashboard = new Dashboard("testDashboard", DashboardArgs.builder()
.folder(test.uid())
.configJson(serializeJson(
jsonObject(
jsonProperty("title", "My Dashboard"),
jsonProperty("uid", "my-dashboard-uid")
)))
.build());
}
}
resources:
test:
type: grafana:oss:Folder
properties:
title: My Folder
uid: my-folder-uid
testDashboard:
type: grafana:oss:Dashboard
name: test
properties:
folder: ${test.uid}
configJson:
fn::toJSON:
title: My Dashboard
uid: my-dashboard-uid
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: DashboardArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Dashboard(resource_name: str,
opts: Optional[ResourceOptions] = None,
config_json: Optional[str] = None,
folder: Optional[str] = None,
message: Optional[str] = None,
org_id: Optional[str] = None,
overwrite: Optional[bool] = None)
func NewDashboard(ctx *Context, name string, args DashboardArgs, opts ...ResourceOption) (*Dashboard, error)
public Dashboard(string name, DashboardArgs args, CustomResourceOptions? opts = null)
public Dashboard(String name, DashboardArgs args)
public Dashboard(String name, DashboardArgs args, CustomResourceOptions options)
type: grafana:oss: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.
Constructor example
The following reference example uses placeholder values for all input properties.
var dashboardResource = new Grafana.Oss.Dashboard("dashboardResource", new()
{
ConfigJson = "string",
Folder = "string",
Message = "string",
OrgId = "string",
Overwrite = false,
});
example, err := oss.NewDashboard(ctx, "dashboardResource", &oss.DashboardArgs{
ConfigJson: pulumi.String("string"),
Folder: pulumi.String("string"),
Message: pulumi.String("string"),
OrgId: pulumi.String("string"),
Overwrite: pulumi.Bool(false),
})
var dashboardResource = new Dashboard("dashboardResource", DashboardArgs.builder()
.configJson("string")
.folder("string")
.message("string")
.orgId("string")
.overwrite(false)
.build());
dashboard_resource = grafana.oss.Dashboard("dashboardResource",
config_json="string",
folder="string",
message="string",
org_id="string",
overwrite=False)
const dashboardResource = new grafana.oss.Dashboard("dashboardResource", {
configJson: "string",
folder: "string",
message: "string",
orgId: "string",
overwrite: false,
});
type: grafana:oss:Dashboard
properties:
configJson: string
folder: string
message: string
orgId: string
overwrite: false
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:
- Config
Json string - The complete dashboard model JSON.
- Folder string
- The id or UID of the folder to save the dashboard in.
- Message string
- Set a commit message for the version history.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- Config
Json string - The complete dashboard model JSON.
- Folder string
- The id or UID of the folder to save the dashboard in.
- Message string
- Set a commit message for the version history.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- config
Json String - The complete dashboard model JSON.
- folder String
- The id or UID of the folder to save the dashboard in.
- message String
- Set a commit message for the version history.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite Boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- config
Json string - The complete dashboard model JSON.
- folder string
- The id or UID of the folder to save the dashboard in.
- message string
- Set a commit message for the version history.
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- config_
json str - The complete dashboard model JSON.
- folder str
- The id or UID of the folder to save the dashboard in.
- message str
- Set a commit message for the version history.
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- config
Json String - The complete dashboard model JSON.
- folder String
- The id or UID of the folder to save the dashboard in.
- message String
- Set a commit message for the version history.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite Boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
Outputs
All input properties are implicitly available as output properties. Additionally, the Dashboard resource produces the following output properties:
- Dashboard
Id int - The numeric ID of the dashboard computed by Grafana.
- Id string
- The provider-assigned unique ID for this managed resource.
- Uid string
- 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.
- Url string
- The full URL of the dashboard.
- Version int
- 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.
- Dashboard
Id int - The numeric ID of the dashboard computed by Grafana.
- Id string
- The provider-assigned unique ID for this managed resource.
- Uid string
- 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.
- Url string
- The full URL of the dashboard.
- Version int
- 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.
- dashboard
Id Integer - The numeric ID of the dashboard computed by Grafana.
- id String
- The provider-assigned unique ID for this managed resource.
- uid String
- 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.
- url String
- The full URL of the dashboard.
- version Integer
- 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.
- dashboard
Id number - The numeric ID of the dashboard computed by Grafana.
- id string
- The provider-assigned unique ID for this managed resource.
- uid string
- 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.
- url string
- The full URL of the dashboard.
- version number
- 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.
- dashboard_
id int - The numeric ID of the dashboard computed by Grafana.
- id str
- The provider-assigned unique ID for this managed resource.
- uid str
- 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.
- url str
- The full URL of the dashboard.
- version int
- 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.
- dashboard
Id Number - The numeric ID of the dashboard computed by Grafana.
- id String
- The provider-assigned unique ID for this managed resource.
- uid String
- 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.
- url String
- The full URL of the dashboard.
- version Number
- 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.
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,
config_json: Optional[str] = None,
dashboard_id: Optional[int] = None,
folder: Optional[str] = None,
message: Optional[str] = None,
org_id: Optional[str] = None,
overwrite: Optional[bool] = None,
uid: Optional[str] = None,
url: Optional[str] = None,
version: Optional[int] = None) -> Dashboard
func 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)
Resource lookup is not supported in YAML
- 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.
- Config
Json string - The complete dashboard model JSON.
- Dashboard
Id int - The numeric ID of the dashboard computed by Grafana.
- Folder string
- The id or UID of the folder to save the dashboard in.
- Message string
- Set a commit message for the version history.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- Uid string
- 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.
- Url string
- The full URL of the dashboard.
- Version int
- 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.
- Config
Json string - The complete dashboard model JSON.
- Dashboard
Id int - The numeric ID of the dashboard computed by Grafana.
- Folder string
- The id or UID of the folder to save the dashboard in.
- Message string
- Set a commit message for the version history.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- Uid string
- 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.
- Url string
- The full URL of the dashboard.
- Version int
- 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.
- config
Json String - The complete dashboard model JSON.
- dashboard
Id Integer - The numeric ID of the dashboard computed by Grafana.
- folder String
- The id or UID of the folder to save the dashboard in.
- message String
- Set a commit message for the version history.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite Boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- uid String
- 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.
- url String
- The full URL of the dashboard.
- version Integer
- 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.
- config
Json string - The complete dashboard model JSON.
- dashboard
Id number - The numeric ID of the dashboard computed by Grafana.
- folder string
- The id or UID of the folder to save the dashboard in.
- message string
- Set a commit message for the version history.
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- uid string
- 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.
- url string
- The full URL of the dashboard.
- version number
- 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.
- config_
json str - The complete dashboard model JSON.
- dashboard_
id int - The numeric ID of the dashboard computed by Grafana.
- folder str
- The id or UID of the folder to save the dashboard in.
- message str
- Set a commit message for the version history.
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite bool
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- uid str
- 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.
- url str
- The full URL of the dashboard.
- version int
- 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.
- config
Json String - The complete dashboard model JSON.
- dashboard
Id Number - The numeric ID of the dashboard computed by Grafana.
- folder String
- The id or UID of the folder to save the dashboard in.
- message String
- Set a commit message for the version history.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- overwrite Boolean
- Set to true if you want to overwrite existing dashboard with newer version, same dashboard title in folder or same dashboard uid.
- uid String
- 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.
- url String
- The full URL of the dashboard.
- version Number
- 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.
Import
$ pulumi import grafana:oss/dashboard:Dashboard name "{{ uid }}"
$ pulumi import grafana:oss/dashboard:Dashboard name "{{ orgID }}:{{ uid }}"
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.