Datadog

v4.11.0 published on Thursday, Sep 8, 2022 by Pulumi

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 Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Datadog.GetDashboardList.InvokeAsync(new Datadog.GetDashboardListArgs
        {
            Name = "My super list",
        }));
        // Create a dashboard and register it in the list above.
        var time = new Datadog.Dashboard("time", new Datadog.DashboardArgs
        {
            DashboardLists = 
            {
                test.Apply(test => test.Id),
            },
            Description = "Created using the Datadog provider in Terraform",
            IsReadOnly = true,
            LayoutType = "ordered",
            Title = "TF Test Layout Dashboard",
            Widgets = 
            {
                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, &GetDashboardListArgs{
			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: DashboardWidgetArray{
				&DashboardWidgetArgs{
					AlertGraphDefinition: &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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var test = Output.of(DatadogFunctions.getDashboardList(GetDashboardListArgs.builder()
            .name("My super list")
            .build()));

        var time = new Dashboard("time", DashboardArgs.builder()        
            .dashboardLists(test.apply(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 = pulumi.output(datadog.getDashboardList({
    name: "My super list",
}));
// Create a dashboard and register it in the list above.
const time = new datadog.Dashboard("time", {
    dashboardLists: [test.apply(test => Number.parseFloat(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:
  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
Name string
name String
name string
name str
name String

getDashboardList Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Name string
Id string

The provider-assigned unique ID for this managed resource.

Name string
id String

The provider-assigned unique ID for this managed resource.

name String
id string

The provider-assigned unique ID for this managed resource.

name string
id str

The provider-assigned unique ID for this managed resource.

name str
id String

The provider-assigned unique ID for this managed resource.

name String

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes

This Pulumi package is based on the datadog Terraform Provider.