Grafana v0.16.1 published on Saturday, Mar 15, 2025 by pulumiverse
grafana.oss.getDashboard
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";
const test = new grafana.oss.Dashboard("test", {configJson: JSON.stringify({
    id: 12345,
    uid: "test-ds-dashboard-uid",
    title: "Production Overview",
    tags: ["templated"],
    timezone: "browser",
    schemaVersion: 16,
    version: 0,
    refresh: "25s",
})});
const fromUid = grafana.oss.getDashboard({
    uid: "test-ds-dashboard-uid",
});
import pulumi
import json
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana
test = grafana.oss.Dashboard("test", config_json=json.dumps({
    "id": 12345,
    "uid": "test-ds-dashboard-uid",
    "title": "Production Overview",
    "tags": ["templated"],
    "timezone": "browser",
    "schemaVersion": 16,
    "version": 0,
    "refresh": "25s",
}))
from_uid = grafana.oss.get_dashboard(uid="test-ds-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 {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"id":    12345,
			"uid":   "test-ds-dashboard-uid",
			"title": "Production Overview",
			"tags": []string{
				"templated",
			},
			"timezone":      "browser",
			"schemaVersion": 16,
			"version":       0,
			"refresh":       "25s",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = oss.NewDashboard(ctx, "test", &oss.DashboardArgs{
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		_, err = oss.LookupDashboard(ctx, &oss.LookupDashboardArgs{
			Uid: pulumi.StringRef("test-ds-dashboard-uid"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Oss.Dashboard("test", new()
    {
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["id"] = 12345,
            ["uid"] = "test-ds-dashboard-uid",
            ["title"] = "Production Overview",
            ["tags"] = new[]
            {
                "templated",
            },
            ["timezone"] = "browser",
            ["schemaVersion"] = 16,
            ["version"] = 0,
            ["refresh"] = "25s",
        }),
    });
    var fromUid = Grafana.Oss.GetDashboard.Invoke(new()
    {
        Uid = "test-ds-dashboard-uid",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.Dashboard;
import com.pulumi.grafana.oss.DashboardArgs;
import com.pulumi.grafana.oss.OssFunctions;
import com.pulumi.grafana.oss.inputs.GetDashboardArgs;
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 Dashboard("test", DashboardArgs.builder()
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("id", 12345),
                    jsonProperty("uid", "test-ds-dashboard-uid"),
                    jsonProperty("title", "Production Overview"),
                    jsonProperty("tags", jsonArray("templated")),
                    jsonProperty("timezone", "browser"),
                    jsonProperty("schemaVersion", 16),
                    jsonProperty("version", 0),
                    jsonProperty("refresh", "25s")
                )))
            .build());
        final var fromUid = OssFunctions.getDashboard(GetDashboardArgs.builder()
            .uid("test-ds-dashboard-uid")
            .build());
    }
}
resources:
  test:
    type: grafana:oss:Dashboard
    properties:
      configJson:
        fn::toJSON:
          id: 12345
          uid: test-ds-dashboard-uid
          title: Production Overview
          tags:
            - templated
          timezone: browser
          schemaVersion: 16
          version: 0
          refresh: 25s
variables:
  fromUid:
    fn::invoke:
      function: grafana:oss:getDashboard
      arguments:
        uid: test-ds-dashboard-uid
Using getDashboard
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDashboard(args: GetDashboardArgs, opts?: InvokeOptions): Promise<GetDashboardResult>
function getDashboardOutput(args: GetDashboardOutputArgs, opts?: InvokeOptions): Output<GetDashboardResult>def get_dashboard(dashboard_id: Optional[int] = None,
                  org_id: Optional[str] = None,
                  uid: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetDashboardResult
def get_dashboard_output(dashboard_id: Optional[pulumi.Input[int]] = None,
                  org_id: Optional[pulumi.Input[str]] = None,
                  uid: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetDashboardResult]func LookupDashboard(ctx *Context, args *LookupDashboardArgs, opts ...InvokeOption) (*LookupDashboardResult, error)
func LookupDashboardOutput(ctx *Context, args *LookupDashboardOutputArgs, opts ...InvokeOption) LookupDashboardResultOutput> Note: This function is named LookupDashboard in the Go SDK.
public static class GetDashboard 
{
    public static Task<GetDashboardResult> InvokeAsync(GetDashboardArgs args, InvokeOptions? opts = null)
    public static Output<GetDashboardResult> Invoke(GetDashboardInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDashboardResult> getDashboard(GetDashboardArgs args, InvokeOptions options)
public static Output<GetDashboardResult> getDashboard(GetDashboardArgs args, InvokeOptions options)
fn::invoke:
  function: grafana:oss/getDashboard:getDashboard
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DashboardId int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- OrgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- DashboardId int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- OrgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- dashboardId Integer
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId String
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid String
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- dashboardId number
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- dashboard_id int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- org_id str
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid str
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- dashboardId Number
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId String
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid String
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
getDashboard Result
The following output properties are available:
- ConfigJson string
- The complete dashboard model JSON.
- FolderUid string
- The UID of the folder where the Grafana dashboard is found.
- Id string
- The provider-assigned unique ID for this managed resource.
- IsStarred bool
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- Slug string
- URL slug of the dashboard (deprecated).
- Title string
- The title of the Grafana dashboard.
- Url string
- The full URL of the dashboard.
- Version int
- The numerical version of the Grafana dashboard.
- DashboardId int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- OrgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- ConfigJson string
- The complete dashboard model JSON.
- FolderUid string
- The UID of the folder where the Grafana dashboard is found.
- Id string
- The provider-assigned unique ID for this managed resource.
- IsStarred bool
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- Slug string
- URL slug of the dashboard (deprecated).
- Title string
- The title of the Grafana dashboard.
- Url string
- The full URL of the dashboard.
- Version int
- The numerical version of the Grafana dashboard.
- DashboardId int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- OrgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- configJson String
- The complete dashboard model JSON.
- folderUid String
- The UID of the folder where the Grafana dashboard is found.
- id String
- The provider-assigned unique ID for this managed resource.
- isStarred Boolean
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- slug String
- URL slug of the dashboard (deprecated).
- title String
- The title of the Grafana dashboard.
- url String
- The full URL of the dashboard.
- version Integer
- The numerical version of the Grafana dashboard.
- dashboardId Integer
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId String
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid String
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- configJson string
- The complete dashboard model JSON.
- folderUid string
- The UID of the folder where the Grafana dashboard is found.
- id string
- The provider-assigned unique ID for this managed resource.
- isStarred boolean
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- slug string
- URL slug of the dashboard (deprecated).
- title string
- The title of the Grafana dashboard.
- url string
- The full URL of the dashboard.
- version number
- The numerical version of the Grafana dashboard.
- dashboardId number
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId string
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid string
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- config_json str
- The complete dashboard model JSON.
- folder_uid str
- The UID of the folder where the Grafana dashboard is found.
- id str
- The provider-assigned unique ID for this managed resource.
- is_starred bool
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- slug str
- URL slug of the dashboard (deprecated).
- title str
- The title of the Grafana dashboard.
- url str
- The full URL of the dashboard.
- version int
- The numerical version of the Grafana dashboard.
- dashboard_id int
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- org_id str
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid str
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
- configJson String
- The complete dashboard model JSON.
- folderUid String
- The UID of the folder where the Grafana dashboard is found.
- id String
- The provider-assigned unique ID for this managed resource.
- isStarred Boolean
- Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
- slug String
- URL slug of the dashboard (deprecated).
- title String
- The title of the Grafana dashboard.
- url String
- The full URL of the dashboard.
- version Number
- The numerical version of the Grafana dashboard.
- dashboardId Number
- The numerical ID of the Grafana dashboard. Specify either this or uid. Defaults to-1.
- orgId String
- The Organization ID. If not set, the Org ID defined in the provider block will be used.
- uid String
- The uid of the Grafana dashboard. Specify either this or dashboard_id. Defaults to ``.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the grafanaTerraform Provider.
