datadog logo
Datadog v4.13.0, Jan 10 23

datadog.getDashboardList

Use this data source to retrieve information about an existing dashboard list, for use in other resources. In particular, it can be used in a dashboard to register it in the list.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Datadog = Pulumi.Datadog;

return await Deployment.RunAsync(() => 
{
    var test = Datadog.GetDashboardList.Invoke(new()
    {
        Name = "My super list",
    });

    // Create a dashboard and register it in the list above.
    var time = new Datadog.Dashboard("time", new()
    {
        DashboardLists = new[]
        {
            test.Apply(getDashboardListResult => getDashboardListResult.Id),
        },
        Description = "Created using the Datadog provider in Terraform",
        IsReadOnly = true,
        LayoutType = "ordered",
        Title = "TF Test Layout Dashboard",
        Widgets = new[]
        {
            new Datadog.Inputs.DashboardWidgetArgs
            {
                AlertGraphDefinition = new Datadog.Inputs.DashboardWidgetAlertGraphDefinitionArgs
                {
                    AlertId = "1234",
                    LiveSpan = "1h",
                    Title = "Widget Title",
                    VizType = "timeseries",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := datadog.LookupDashboardList(ctx, &datadog.LookupDashboardListArgs{
			Name: "My super list",
		}, nil)
		if err != nil {
			return err
		}
		_, err = datadog.NewDashboard(ctx, "time", &datadog.DashboardArgs{
			DashboardLists: pulumi.IntArray{
				*pulumi.String(test.Id),
			},
			Description: pulumi.String("Created using the Datadog provider in Terraform"),
			IsReadOnly:  pulumi.Bool(true),
			LayoutType:  pulumi.String("ordered"),
			Title:       pulumi.String("TF Test Layout Dashboard"),
			Widgets: datadog.DashboardWidgetArray{
				&datadog.DashboardWidgetArgs{
					AlertGraphDefinition: &datadog.DashboardWidgetAlertGraphDefinitionArgs{
						AlertId:  pulumi.String("1234"),
						LiveSpan: pulumi.String("1h"),
						Title:    pulumi.String("Widget Title"),
						VizType:  pulumi.String("timeseries"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.DatadogFunctions;
import com.pulumi.datadog.inputs.GetDashboardListArgs;
import com.pulumi.datadog.Dashboard;
import com.pulumi.datadog.DashboardArgs;
import com.pulumi.datadog.inputs.DashboardWidgetArgs;
import com.pulumi.datadog.inputs.DashboardWidgetAlertGraphDefinitionArgs;
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) {
        final var test = DatadogFunctions.getDashboardList(GetDashboardListArgs.builder()
            .name("My super list")
            .build());

        var time = new Dashboard("time", DashboardArgs.builder()        
            .dashboardLists(test.applyValue(getDashboardListResult -> getDashboardListResult.id()))
            .description("Created using the Datadog provider in Terraform")
            .isReadOnly(true)
            .layoutType("ordered")
            .title("TF Test Layout Dashboard")
            .widgets(DashboardWidgetArgs.builder()
                .alertGraphDefinition(DashboardWidgetAlertGraphDefinitionArgs.builder()
                    .alertId("1234")
                    .liveSpan("1h")
                    .title("Widget Title")
                    .vizType("timeseries")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_datadog as datadog

test = datadog.get_dashboard_list(name="My super list")
# Create a dashboard and register it in the list above.
time = datadog.Dashboard("time",
    dashboard_lists=[test.id],
    description="Created using the Datadog provider in Terraform",
    is_read_only=True,
    layout_type="ordered",
    title="TF Test Layout Dashboard",
    widgets=[datadog.DashboardWidgetArgs(
        alert_graph_definition=datadog.DashboardWidgetAlertGraphDefinitionArgs(
            alert_id="1234",
            live_span="1h",
            title="Widget Title",
            viz_type="timeseries",
        ),
    )])
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

const test = datadog.getDashboardList({
    name: "My super list",
});
// Create a dashboard and register it in the list above.
const time = new datadog.Dashboard("time", {
    dashboardLists: [test.then(test => test.id)],
    description: "Created using the Datadog provider in Terraform",
    isReadOnly: true,
    layoutType: "ordered",
    title: "TF Test Layout Dashboard",
    widgets: [{
        alertGraphDefinition: {
            alertId: "1234",
            liveSpan: "1h",
            title: "Widget Title",
            vizType: "timeseries",
        },
    }],
});
resources:
  # Create a dashboard and register it in the list above.
  time:
    type: datadog:Dashboard
    properties:
      dashboardLists:
        - ${test.id}
      description: Created using the Datadog provider in Terraform
      isReadOnly: true
      layoutType: ordered
      title: TF Test Layout Dashboard
      widgets:
        - alertGraphDefinition:
            alertId: '1234'
            liveSpan: 1h
            title: Widget Title
            vizType: timeseries
variables:
  test:
    fn::invoke:
      Function: datadog:getDashboardList
      Arguments:
        name: My super list

Using getDashboardList

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 getDashboardList(args: GetDashboardListArgs, opts?: InvokeOptions): Promise<GetDashboardListResult>
function getDashboardListOutput(args: GetDashboardListOutputArgs, opts?: InvokeOptions): Output<GetDashboardListResult>
def get_dashboard_list(name: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetDashboardListResult
def get_dashboard_list_output(name: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetDashboardListResult]
func LookupDashboardList(ctx *Context, args *LookupDashboardListArgs, opts ...InvokeOption) (*LookupDashboardListResult, error)
func LookupDashboardListOutput(ctx *Context, args *LookupDashboardListOutputArgs, opts ...InvokeOption) LookupDashboardListResultOutput

> Note: This function is named LookupDashboardList in the Go SDK.

public static class GetDashboardList 
{
    public static Task<GetDashboardListResult> InvokeAsync(GetDashboardListArgs args, InvokeOptions? opts = null)
    public static Output<GetDashboardListResult> Invoke(GetDashboardListInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDashboardListResult> getDashboardList(GetDashboardListArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: datadog:index/getDashboardList:getDashboardList
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

A dashboard list name to limit the search.

Name string

A dashboard list name to limit the search.

name String

A dashboard list name to limit the search.

name string

A dashboard list name to limit the search.

name str

A dashboard list name to limit the search.

name String

A dashboard list name to limit the search.

getDashboardList Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Name string

A dashboard list name to limit the search.

Id string

The provider-assigned unique ID for this managed resource.

Name string

A dashboard list name to limit the search.

id String

The provider-assigned unique ID for this managed resource.

name String

A dashboard list name to limit the search.

id string

The provider-assigned unique ID for this managed resource.

name string

A dashboard list name to limit the search.

id str

The provider-assigned unique ID for this managed resource.

name str

A dashboard list name to limit the search.

id String

The provider-assigned unique ID for this managed resource.

name String

A dashboard list name to limit the search.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes

This Pulumi package is based on the datadog Terraform Provider.