1. Packages
  2. Datadog Provider
  3. API Docs
  4. getDashboardList
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

datadog.getDashboardList

Explore with Pulumi AI

datadog logo
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

    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

    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", {
        title: "TF Test Layout Dashboard",
        description: "Created using the Datadog provider in Pulumi",
        dashboardLists: [test.then(test => test.id)],
        layoutType: "ordered",
        isReadOnly: true,
        widgets: [{
            alertGraphDefinition: {
                alertId: "1234",
                vizType: "timeseries",
                title: "Widget Title",
                liveSpan: "1h",
            },
        }],
    });
    
    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",
        title="TF Test Layout Dashboard",
        description="Created using the Datadog provider in Pulumi",
        dashboard_lists=[test.id],
        layout_type="ordered",
        is_read_only=True,
        widgets=[{
            "alert_graph_definition": {
                "alert_id": "1234",
                "viz_type": "timeseries",
                "title": "Widget Title",
                "live_span": "1h",
            },
        }])
    
    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
    		}
    		// Create a dashboard and register it in the list above.
    		_, err = datadog.NewDashboard(ctx, "time", &datadog.DashboardArgs{
    			Title:       pulumi.String("TF Test Layout Dashboard"),
    			Description: pulumi.String("Created using the Datadog provider in Pulumi"),
    			DashboardLists: pulumi.IntArray{
    				pulumi.String(test.Id),
    			},
    			LayoutType: pulumi.String("ordered"),
    			IsReadOnly: pulumi.Bool(true),
    			Widgets: datadog.DashboardWidgetArray{
    				&datadog.DashboardWidgetArgs{
    					AlertGraphDefinition: &datadog.DashboardWidgetAlertGraphDefinitionArgs{
    						AlertId:  pulumi.String("1234"),
    						VizType:  pulumi.String("timeseries"),
    						Title:    pulumi.String("Widget Title"),
    						LiveSpan: pulumi.String("1h"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    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()
        {
            Title = "TF Test Layout Dashboard",
            Description = "Created using the Datadog provider in Pulumi",
            DashboardLists = new[]
            {
                test.Apply(getDashboardListResult => getDashboardListResult.Id),
            },
            LayoutType = "ordered",
            IsReadOnly = true,
            Widgets = new[]
            {
                new Datadog.Inputs.DashboardWidgetArgs
                {
                    AlertGraphDefinition = new Datadog.Inputs.DashboardWidgetAlertGraphDefinitionArgs
                    {
                        AlertId = "1234",
                        VizType = "timeseries",
                        Title = "Widget Title",
                        LiveSpan = "1h",
                    },
                },
            },
        });
    
    });
    
    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());
    
            // Create a dashboard and register it in the list above.
            var time = new Dashboard("time", DashboardArgs.builder()
                .title("TF Test Layout Dashboard")
                .description("Created using the Datadog provider in Pulumi")
                .dashboardLists(test.applyValue(getDashboardListResult -> getDashboardListResult.id()))
                .layoutType("ordered")
                .isReadOnly(true)
                .widgets(DashboardWidgetArgs.builder()
                    .alertGraphDefinition(DashboardWidgetAlertGraphDefinitionArgs.builder()
                        .alertId("1234")
                        .vizType("timeseries")
                        .title("Widget Title")
                        .liveSpan("1h")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a dashboard and register it in the list above.
      time:
        type: datadog:Dashboard
        properties:
          title: TF Test Layout Dashboard
          description: Created using the Datadog provider in Pulumi
          dashboardLists:
            - ${test.id}
          layoutType: ordered
          isReadOnly: true
          widgets:
            - alertGraphDefinition:
                alertId: '1234'
                vizType: timeseries
                title: Widget Title
                liveSpan: 1h
    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 ID of this resource.
    Name string
    A dashboard list name to limit the search.
    Id string
    The ID of this resource.
    Name string
    A dashboard list name to limit the search.
    id String
    The ID of this resource.
    name String
    A dashboard list name to limit the search.
    id string
    The ID of this resource.
    name string
    A dashboard list name to limit the search.
    id str
    The ID of this resource.
    name str
    A dashboard list name to limit the search.
    id String
    The ID of this 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.
    datadog logo
    Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi