1. Packages
  2. Datadog Provider
  3. API Docs
  4. DashboardJson
Datadog v4.48.1 published on Saturday, Apr 5, 2025 by Pulumi

datadog.DashboardJson

Explore with Pulumi AI

Provides a Datadog dashboard JSON resource. This can be used to create and manage Datadog dashboards using the JSON definition.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

// Example Dashboard JSON
const dashboardJson = new datadog.DashboardJson("dashboard_json", {dashboard: `{
   "title":"Ordered Layout Dashboard",
   "description":"Created using the Datadog provider in Pulumi",
   "widgets":[
      {
         "id":719369537777170,
         "definition":{
            "title":"Widget Title",
            "type":"alert_graph",
            "alert_id":"895605",
            "viz_type":"timeseries"
         }
      },
      {
         "id":2306240030393868,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":6990998850881326,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":3351284044659007,
         "definition":{
            "title":"Widget Title",
            "type":"change",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "compare_to":"week_before",
                  "change_type":"absolute",
                  "order_dir":"desc",
                  "increase_good":true,
                  "order_by":"name",
                  "show_present":true
               }
            ]
         }
      },
      {
         "id":6450290622996182,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"distribution",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":4902842646291536,
         "definition":{
            "title":"Widget Title",
            "type":"check_status",
            "check":"aws.ecs.agent_connected",
            "grouping":"cluster",
            "group_by":[
               "account",
               "cluster"
            ],
            "tags":[
               "account:demo",
               "cluster:awseb-ruthebdog-env-8-dn3m6u3gvk"
            ]
         }
      },
      {
         "id":6392349954822644,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"heatmap",
            "yaxis":{
               "scale":"sqrt",
               "include_zero":true,
               "min":"1",
               "max":"2"
            },
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":5222961478940988,
         "definition":{
            "title":"Widget Title",
            "type":"hostmap",
            "requests":{
               "fill":{
                  "q":"avg:system.load.1{*} by {host}"
               },
               "size":{
                  "q":"avg:memcache.uptime{*} by {host}"
               }
            },
            "node_type":"container",
            "no_metric_hosts":true,
            "no_group_hosts":true,
            "group":[
               "host",
               "region"
            ],
            "scope":[
               "region:us-east-1",
               "aws_account:727006795293"
            ],
            "style":{
               "palette":"yellow_to_green",
               "palette_flip":true,
               "fill_min":"10",
               "fill_max":"20"
            }
         }
      },
      {
         "id":8121199734227072,
         "definition":{
            "type":"note",
            "content":"note text",
            "background_color":"pink",
            "font_size":"14",
            "text_align":"center",
            "show_tick":true,
            "tick_pos":"50%",
            "tick_edge":"left"
         }
      },
      {
         "id":1775856835833038,
         "definition":{
            "title":"Widget Title",
            "type":"query_value",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ],
            "autoscale":true,
            "custom_unit":"xx",
            "text_align":"right",
            "precision":4
         }
      },
      {
         "id":8461455966625581,
         "definition":{
            "title":"Widget Title",
            "type":"query_table",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ],
                  "limit":10
               }
            ]
         }
      },
      {
         "id":8660006349418736,
         "definition":{
            "title":"Widget Title",
            "type":"scatterplot",
            "requests":{
               "x":{
                  "q":"avg:system.cpu.user{*} by {service, account}",
                  "aggregator":"max"
               },
               "y":{
                  "q":"avg:system.mem.used{*} by {service, account}",
                  "aggregator":"min"
               }
            },
            "xaxis":{
               "scale":"pow",
               "label":"x",
               "include_zero":true,
               "min":"1",
               "max":"2000"
            },
            "yaxis":{
               "scale":"log",
               "label":"y",
               "include_zero":false,
               "min":"5",
               "max":"2222"
            },
            "color_by_groups":[
               "account",
               "apm-role-group"
            ]
         }
      },
      {
         "id":1669590772917638,
         "definition":{
            "title":"env: prod, datacenter:dc1, service: master-db",
            "title_size":"16",
            "title_align":"left",
            "type":"servicemap",
            "service":"master-db",
            "filters":[
               "env:prod",
               "datacenter:dc1"
            ]
         }
      },
      {
         "id":2138829058361817,
         "definition":{
            "title":"Widget Title",
            "show_legend":true,
            "legend_size":"2",
            "type":"timeseries",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "on_right_yaxis":false,
                  "metadata":[
                     {
                        "expression":"avg:system.cpu.user{app:general} by {env}",
                        "alias_name":"Alpha"
                     }
                  ],
                  "style":{
                     "palette":"warm",
                     "line_type":"dashed",
                     "line_width":"thin"
                  },
                  "display_type":"line"
               },
               {
                  "on_right_yaxis":false,
                  "log_query":{
                     "index":"mcnulty",
                     "search":{
                        "query":"status:info"
                     },
                     "group_by":[
                        {
                           "facet":"host",
                           "sort":{
                              "facet":"@duration",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":10
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"area"
               },
               {
                  "on_right_yaxis":false,
                  "apm_query":{
                     "index":"apm-search",
                     "search":{
                        "query":"type:web"
                     },
                     "group_by":[
                        {
                           "facet":"resource_name",
                           "sort":{
                              "facet":"@string_query.interval",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":50
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"bars"
               },
               {
                  "on_right_yaxis":false,
                  "process_query":{
                     "search_by":"error",
                     "metric":"process.stat.cpu.total_pct",
                     "limit":50,
                     "filter_by":[
                        "active"
                     ]
                  },
                  "display_type":"area"
               }
            ],
            "yaxis":{
               "scale":"log",
               "include_zero":false,
               "max":"100"
            },
            "events":[
               {
                  "q":"sources:test tags:1"
               },
               {
                  "q":"sources:test tags:2"
               }
            ],
            "markers":[
               {
                  "label":" z=6 ",
                  "value":"y = 4",
                  "display_type":"error dashed"
               },
               {
                  "label":" x=8 ",
                  "value":"10 < y < 999",
                  "display_type":"ok solid"
               }
            ]
         }
      },
      {
         "id":7307171374656551,
         "definition":{
            "title":"Widget Title",
            "type":"toplist",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ]
         }
      },
      {
         "id":7086674838553258,
         "definition":{
            "title":"Group Widget",
            "type":"group",
            "layout_type":"ordered",
            "widgets":[
               {
                  "id":3726092277657502,
                  "definition":{
                     "type":"note",
                     "content":"cluster note widget",
                     "background_color":"pink",
                     "font_size":"14",
                     "text_align":"center",
                     "show_tick":true,
                     "tick_pos":"50%",
                     "tick_edge":"left"
                  }
               },
               {
                  "id":6376384650558057,
                  "definition":{
                     "title":"Alert Graph",
                     "type":"alert_graph",
                     "alert_id":"123",
                     "viz_type":"toplist"
                  }
               }
            ]
         }
      },
      {
         "id":4668903563678912,
         "definition":{
            "title":"Widget Title",
            "type":"slo",
            "view_type":"detail",
            "time_windows":[
               "7d",
               "previous_week"
            ],
            "slo_id":"56789",
            "show_error_budget":true,
            "view_mode":"overall",
            "global_time_target":"0"
         }
      }
   ],
   "template_variables":[
      {
         "name":"var_1",
         "default":"aws",
         "prefix":"host"
      },
      {
         "name":"var_2",
         "default":"autoscaling",
         "prefix":"service_name"
      }
   ],
   "layout_type":"ordered",
   "is_read_only":true,
   "notify_list":[

   ],
   "template_variable_presets":[
      {
         "name":"preset_1",
         "template_variables":[
            {
               "name":"var_1",
               "value":"host.dc"
            },
            {
               "name":"var_2",
               "value":"my_service"
            }
         ]
      }
   ]
}
`});
Copy
import pulumi
import pulumi_datadog as datadog

# Example Dashboard JSON
dashboard_json = datadog.DashboardJson("dashboard_json", dashboard="""{
   "title":"Ordered Layout Dashboard",
   "description":"Created using the Datadog provider in Pulumi",
   "widgets":[
      {
         "id":719369537777170,
         "definition":{
            "title":"Widget Title",
            "type":"alert_graph",
            "alert_id":"895605",
            "viz_type":"timeseries"
         }
      },
      {
         "id":2306240030393868,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":6990998850881326,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":3351284044659007,
         "definition":{
            "title":"Widget Title",
            "type":"change",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "compare_to":"week_before",
                  "change_type":"absolute",
                  "order_dir":"desc",
                  "increase_good":true,
                  "order_by":"name",
                  "show_present":true
               }
            ]
         }
      },
      {
         "id":6450290622996182,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"distribution",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":4902842646291536,
         "definition":{
            "title":"Widget Title",
            "type":"check_status",
            "check":"aws.ecs.agent_connected",
            "grouping":"cluster",
            "group_by":[
               "account",
               "cluster"
            ],
            "tags":[
               "account:demo",
               "cluster:awseb-ruthebdog-env-8-dn3m6u3gvk"
            ]
         }
      },
      {
         "id":6392349954822644,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"heatmap",
            "yaxis":{
               "scale":"sqrt",
               "include_zero":true,
               "min":"1",
               "max":"2"
            },
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":5222961478940988,
         "definition":{
            "title":"Widget Title",
            "type":"hostmap",
            "requests":{
               "fill":{
                  "q":"avg:system.load.1{*} by {host}"
               },
               "size":{
                  "q":"avg:memcache.uptime{*} by {host}"
               }
            },
            "node_type":"container",
            "no_metric_hosts":true,
            "no_group_hosts":true,
            "group":[
               "host",
               "region"
            ],
            "scope":[
               "region:us-east-1",
               "aws_account:727006795293"
            ],
            "style":{
               "palette":"yellow_to_green",
               "palette_flip":true,
               "fill_min":"10",
               "fill_max":"20"
            }
         }
      },
      {
         "id":8121199734227072,
         "definition":{
            "type":"note",
            "content":"note text",
            "background_color":"pink",
            "font_size":"14",
            "text_align":"center",
            "show_tick":true,
            "tick_pos":"50%",
            "tick_edge":"left"
         }
      },
      {
         "id":1775856835833038,
         "definition":{
            "title":"Widget Title",
            "type":"query_value",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ],
            "autoscale":true,
            "custom_unit":"xx",
            "text_align":"right",
            "precision":4
         }
      },
      {
         "id":8461455966625581,
         "definition":{
            "title":"Widget Title",
            "type":"query_table",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ],
                  "limit":10
               }
            ]
         }
      },
      {
         "id":8660006349418736,
         "definition":{
            "title":"Widget Title",
            "type":"scatterplot",
            "requests":{
               "x":{
                  "q":"avg:system.cpu.user{*} by {service, account}",
                  "aggregator":"max"
               },
               "y":{
                  "q":"avg:system.mem.used{*} by {service, account}",
                  "aggregator":"min"
               }
            },
            "xaxis":{
               "scale":"pow",
               "label":"x",
               "include_zero":true,
               "min":"1",
               "max":"2000"
            },
            "yaxis":{
               "scale":"log",
               "label":"y",
               "include_zero":false,
               "min":"5",
               "max":"2222"
            },
            "color_by_groups":[
               "account",
               "apm-role-group"
            ]
         }
      },
      {
         "id":1669590772917638,
         "definition":{
            "title":"env: prod, datacenter:dc1, service: master-db",
            "title_size":"16",
            "title_align":"left",
            "type":"servicemap",
            "service":"master-db",
            "filters":[
               "env:prod",
               "datacenter:dc1"
            ]
         }
      },
      {
         "id":2138829058361817,
         "definition":{
            "title":"Widget Title",
            "show_legend":true,
            "legend_size":"2",
            "type":"timeseries",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "on_right_yaxis":false,
                  "metadata":[
                     {
                        "expression":"avg:system.cpu.user{app:general} by {env}",
                        "alias_name":"Alpha"
                     }
                  ],
                  "style":{
                     "palette":"warm",
                     "line_type":"dashed",
                     "line_width":"thin"
                  },
                  "display_type":"line"
               },
               {
                  "on_right_yaxis":false,
                  "log_query":{
                     "index":"mcnulty",
                     "search":{
                        "query":"status:info"
                     },
                     "group_by":[
                        {
                           "facet":"host",
                           "sort":{
                              "facet":"@duration",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":10
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"area"
               },
               {
                  "on_right_yaxis":false,
                  "apm_query":{
                     "index":"apm-search",
                     "search":{
                        "query":"type:web"
                     },
                     "group_by":[
                        {
                           "facet":"resource_name",
                           "sort":{
                              "facet":"@string_query.interval",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":50
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"bars"
               },
               {
                  "on_right_yaxis":false,
                  "process_query":{
                     "search_by":"error",
                     "metric":"process.stat.cpu.total_pct",
                     "limit":50,
                     "filter_by":[
                        "active"
                     ]
                  },
                  "display_type":"area"
               }
            ],
            "yaxis":{
               "scale":"log",
               "include_zero":false,
               "max":"100"
            },
            "events":[
               {
                  "q":"sources:test tags:1"
               },
               {
                  "q":"sources:test tags:2"
               }
            ],
            "markers":[
               {
                  "label":" z=6 ",
                  "value":"y = 4",
                  "display_type":"error dashed"
               },
               {
                  "label":" x=8 ",
                  "value":"10 < y < 999",
                  "display_type":"ok solid"
               }
            ]
         }
      },
      {
         "id":7307171374656551,
         "definition":{
            "title":"Widget Title",
            "type":"toplist",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ]
         }
      },
      {
         "id":7086674838553258,
         "definition":{
            "title":"Group Widget",
            "type":"group",
            "layout_type":"ordered",
            "widgets":[
               {
                  "id":3726092277657502,
                  "definition":{
                     "type":"note",
                     "content":"cluster note widget",
                     "background_color":"pink",
                     "font_size":"14",
                     "text_align":"center",
                     "show_tick":true,
                     "tick_pos":"50%",
                     "tick_edge":"left"
                  }
               },
               {
                  "id":6376384650558057,
                  "definition":{
                     "title":"Alert Graph",
                     "type":"alert_graph",
                     "alert_id":"123",
                     "viz_type":"toplist"
                  }
               }
            ]
         }
      },
      {
         "id":4668903563678912,
         "definition":{
            "title":"Widget Title",
            "type":"slo",
            "view_type":"detail",
            "time_windows":[
               "7d",
               "previous_week"
            ],
            "slo_id":"56789",
            "show_error_budget":true,
            "view_mode":"overall",
            "global_time_target":"0"
         }
      }
   ],
   "template_variables":[
      {
         "name":"var_1",
         "default":"aws",
         "prefix":"host"
      },
      {
         "name":"var_2",
         "default":"autoscaling",
         "prefix":"service_name"
      }
   ],
   "layout_type":"ordered",
   "is_read_only":true,
   "notify_list":[

   ],
   "template_variable_presets":[
      {
         "name":"preset_1",
         "template_variables":[
            {
               "name":"var_1",
               "value":"host.dc"
            },
            {
               "name":"var_2",
               "value":"my_service"
            }
         ]
      }
   ]
}
""")
Copy
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 {
		// Example Dashboard JSON
		_, err := datadog.NewDashboardJson(ctx, "dashboard_json", &datadog.DashboardJsonArgs{
			Dashboard: pulumi.String(`{
   "title":"Ordered Layout Dashboard",
   "description":"Created using the Datadog provider in Pulumi",
   "widgets":[
      {
         "id":719369537777170,
         "definition":{
            "title":"Widget Title",
            "type":"alert_graph",
            "alert_id":"895605",
            "viz_type":"timeseries"
         }
      },
      {
         "id":2306240030393868,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":6990998850881326,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":3351284044659007,
         "definition":{
            "title":"Widget Title",
            "type":"change",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "compare_to":"week_before",
                  "change_type":"absolute",
                  "order_dir":"desc",
                  "increase_good":true,
                  "order_by":"name",
                  "show_present":true
               }
            ]
         }
      },
      {
         "id":6450290622996182,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"distribution",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":4902842646291536,
         "definition":{
            "title":"Widget Title",
            "type":"check_status",
            "check":"aws.ecs.agent_connected",
            "grouping":"cluster",
            "group_by":[
               "account",
               "cluster"
            ],
            "tags":[
               "account:demo",
               "cluster:awseb-ruthebdog-env-8-dn3m6u3gvk"
            ]
         }
      },
      {
         "id":6392349954822644,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"heatmap",
            "yaxis":{
               "scale":"sqrt",
               "include_zero":true,
               "min":"1",
               "max":"2"
            },
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":5222961478940988,
         "definition":{
            "title":"Widget Title",
            "type":"hostmap",
            "requests":{
               "fill":{
                  "q":"avg:system.load.1{*} by {host}"
               },
               "size":{
                  "q":"avg:memcache.uptime{*} by {host}"
               }
            },
            "node_type":"container",
            "no_metric_hosts":true,
            "no_group_hosts":true,
            "group":[
               "host",
               "region"
            ],
            "scope":[
               "region:us-east-1",
               "aws_account:727006795293"
            ],
            "style":{
               "palette":"yellow_to_green",
               "palette_flip":true,
               "fill_min":"10",
               "fill_max":"20"
            }
         }
      },
      {
         "id":8121199734227072,
         "definition":{
            "type":"note",
            "content":"note text",
            "background_color":"pink",
            "font_size":"14",
            "text_align":"center",
            "show_tick":true,
            "tick_pos":"50%",
            "tick_edge":"left"
         }
      },
      {
         "id":1775856835833038,
         "definition":{
            "title":"Widget Title",
            "type":"query_value",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ],
            "autoscale":true,
            "custom_unit":"xx",
            "text_align":"right",
            "precision":4
         }
      },
      {
         "id":8461455966625581,
         "definition":{
            "title":"Widget Title",
            "type":"query_table",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ],
                  "limit":10
               }
            ]
         }
      },
      {
         "id":8660006349418736,
         "definition":{
            "title":"Widget Title",
            "type":"scatterplot",
            "requests":{
               "x":{
                  "q":"avg:system.cpu.user{*} by {service, account}",
                  "aggregator":"max"
               },
               "y":{
                  "q":"avg:system.mem.used{*} by {service, account}",
                  "aggregator":"min"
               }
            },
            "xaxis":{
               "scale":"pow",
               "label":"x",
               "include_zero":true,
               "min":"1",
               "max":"2000"
            },
            "yaxis":{
               "scale":"log",
               "label":"y",
               "include_zero":false,
               "min":"5",
               "max":"2222"
            },
            "color_by_groups":[
               "account",
               "apm-role-group"
            ]
         }
      },
      {
         "id":1669590772917638,
         "definition":{
            "title":"env: prod, datacenter:dc1, service: master-db",
            "title_size":"16",
            "title_align":"left",
            "type":"servicemap",
            "service":"master-db",
            "filters":[
               "env:prod",
               "datacenter:dc1"
            ]
         }
      },
      {
         "id":2138829058361817,
         "definition":{
            "title":"Widget Title",
            "show_legend":true,
            "legend_size":"2",
            "type":"timeseries",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "on_right_yaxis":false,
                  "metadata":[
                     {
                        "expression":"avg:system.cpu.user{app:general} by {env}",
                        "alias_name":"Alpha"
                     }
                  ],
                  "style":{
                     "palette":"warm",
                     "line_type":"dashed",
                     "line_width":"thin"
                  },
                  "display_type":"line"
               },
               {
                  "on_right_yaxis":false,
                  "log_query":{
                     "index":"mcnulty",
                     "search":{
                        "query":"status:info"
                     },
                     "group_by":[
                        {
                           "facet":"host",
                           "sort":{
                              "facet":"@duration",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":10
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"area"
               },
               {
                  "on_right_yaxis":false,
                  "apm_query":{
                     "index":"apm-search",
                     "search":{
                        "query":"type:web"
                     },
                     "group_by":[
                        {
                           "facet":"resource_name",
                           "sort":{
                              "facet":"@string_query.interval",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":50
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"bars"
               },
               {
                  "on_right_yaxis":false,
                  "process_query":{
                     "search_by":"error",
                     "metric":"process.stat.cpu.total_pct",
                     "limit":50,
                     "filter_by":[
                        "active"
                     ]
                  },
                  "display_type":"area"
               }
            ],
            "yaxis":{
               "scale":"log",
               "include_zero":false,
               "max":"100"
            },
            "events":[
               {
                  "q":"sources:test tags:1"
               },
               {
                  "q":"sources:test tags:2"
               }
            ],
            "markers":[
               {
                  "label":" z=6 ",
                  "value":"y = 4",
                  "display_type":"error dashed"
               },
               {
                  "label":" x=8 ",
                  "value":"10 < y < 999",
                  "display_type":"ok solid"
               }
            ]
         }
      },
      {
         "id":7307171374656551,
         "definition":{
            "title":"Widget Title",
            "type":"toplist",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ]
         }
      },
      {
         "id":7086674838553258,
         "definition":{
            "title":"Group Widget",
            "type":"group",
            "layout_type":"ordered",
            "widgets":[
               {
                  "id":3726092277657502,
                  "definition":{
                     "type":"note",
                     "content":"cluster note widget",
                     "background_color":"pink",
                     "font_size":"14",
                     "text_align":"center",
                     "show_tick":true,
                     "tick_pos":"50%",
                     "tick_edge":"left"
                  }
               },
               {
                  "id":6376384650558057,
                  "definition":{
                     "title":"Alert Graph",
                     "type":"alert_graph",
                     "alert_id":"123",
                     "viz_type":"toplist"
                  }
               }
            ]
         }
      },
      {
         "id":4668903563678912,
         "definition":{
            "title":"Widget Title",
            "type":"slo",
            "view_type":"detail",
            "time_windows":[
               "7d",
               "previous_week"
            ],
            "slo_id":"56789",
            "show_error_budget":true,
            "view_mode":"overall",
            "global_time_target":"0"
         }
      }
   ],
   "template_variables":[
      {
         "name":"var_1",
         "default":"aws",
         "prefix":"host"
      },
      {
         "name":"var_2",
         "default":"autoscaling",
         "prefix":"service_name"
      }
   ],
   "layout_type":"ordered",
   "is_read_only":true,
   "notify_list":[

   ],
   "template_variable_presets":[
      {
         "name":"preset_1",
         "template_variables":[
            {
               "name":"var_1",
               "value":"host.dc"
            },
            {
               "name":"var_2",
               "value":"my_service"
            }
         ]
      }
   ]
}
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;

return await Deployment.RunAsync(() => 
{
    // Example Dashboard JSON
    var dashboardJson = new Datadog.DashboardJson("dashboard_json", new()
    {
        Dashboard = @"{
   ""title"":""Ordered Layout Dashboard"",
   ""description"":""Created using the Datadog provider in Pulumi"",
   ""widgets"":[
      {
         ""id"":719369537777170,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""alert_graph"",
            ""alert_id"":""895605"",
            ""viz_type"":""timeseries""
         }
      },
      {
         ""id"":2306240030393868,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""alert_value"",
            ""alert_id"":""895605"",
            ""unit"":""b"",
            ""text_align"":""center"",
            ""precision"":3
         }
      },
      {
         ""id"":6990998850881326,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""alert_value"",
            ""alert_id"":""895605"",
            ""unit"":""b"",
            ""text_align"":""center"",
            ""precision"":3
         }
      },
      {
         ""id"":3351284044659007,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""change"",
            ""requests"":[
               {
                  ""q"":""avg:system.load.1{env:staging} by {account}"",
                  ""compare_to"":""week_before"",
                  ""change_type"":""absolute"",
                  ""order_dir"":""desc"",
                  ""increase_good"":true,
                  ""order_by"":""name"",
                  ""show_present"":true
               }
            ]
         }
      },
      {
         ""id"":6450290622996182,
         ""definition"":{
            ""title"":""Widget Title"",
            ""show_legend"":false,
            ""type"":""distribution"",
            ""requests"":[
               {
                  ""q"":""avg:system.load.1{env:staging} by {account}"",
                  ""style"":{
                     ""palette"":""warm""
                  }
               }
            ]
         }
      },
      {
         ""id"":4902842646291536,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""check_status"",
            ""check"":""aws.ecs.agent_connected"",
            ""grouping"":""cluster"",
            ""group_by"":[
               ""account"",
               ""cluster""
            ],
            ""tags"":[
               ""account:demo"",
               ""cluster:awseb-ruthebdog-env-8-dn3m6u3gvk""
            ]
         }
      },
      {
         ""id"":6392349954822644,
         ""definition"":{
            ""title"":""Widget Title"",
            ""show_legend"":false,
            ""type"":""heatmap"",
            ""yaxis"":{
               ""scale"":""sqrt"",
               ""include_zero"":true,
               ""min"":""1"",
               ""max"":""2""
            },
            ""requests"":[
               {
                  ""q"":""avg:system.load.1{env:staging} by {account}"",
                  ""style"":{
                     ""palette"":""warm""
                  }
               }
            ]
         }
      },
      {
         ""id"":5222961478940988,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""hostmap"",
            ""requests"":{
               ""fill"":{
                  ""q"":""avg:system.load.1{*} by {host}""
               },
               ""size"":{
                  ""q"":""avg:memcache.uptime{*} by {host}""
               }
            },
            ""node_type"":""container"",
            ""no_metric_hosts"":true,
            ""no_group_hosts"":true,
            ""group"":[
               ""host"",
               ""region""
            ],
            ""scope"":[
               ""region:us-east-1"",
               ""aws_account:727006795293""
            ],
            ""style"":{
               ""palette"":""yellow_to_green"",
               ""palette_flip"":true,
               ""fill_min"":""10"",
               ""fill_max"":""20""
            }
         }
      },
      {
         ""id"":8121199734227072,
         ""definition"":{
            ""type"":""note"",
            ""content"":""note text"",
            ""background_color"":""pink"",
            ""font_size"":""14"",
            ""text_align"":""center"",
            ""show_tick"":true,
            ""tick_pos"":""50%"",
            ""tick_edge"":""left""
         }
      },
      {
         ""id"":1775856835833038,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""query_value"",
            ""requests"":[
               {
                  ""q"":""avg:system.load.1{env:staging} by {account}"",
                  ""aggregator"":""sum"",
                  ""conditional_formats"":[
                     {
                        ""hide_value"":false,
                        ""comparator"":""<"",
                        ""palette"":""white_on_green"",
                        ""value"":2
                     },
                     {
                        ""hide_value"":false,
                        ""comparator"":"">"",
                        ""palette"":""white_on_red"",
                        ""value"":2.2
                     }
                  ]
               }
            ],
            ""autoscale"":true,
            ""custom_unit"":""xx"",
            ""text_align"":""right"",
            ""precision"":4
         }
      },
      {
         ""id"":8461455966625581,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""query_table"",
            ""requests"":[
               {
                  ""q"":""avg:system.load.1{env:staging} by {account}"",
                  ""aggregator"":""sum"",
                  ""conditional_formats"":[
                     {
                        ""hide_value"":false,
                        ""comparator"":""<"",
                        ""palette"":""white_on_green"",
                        ""value"":2
                     },
                     {
                        ""hide_value"":false,
                        ""comparator"":"">"",
                        ""palette"":""white_on_red"",
                        ""value"":2.2
                     }
                  ],
                  ""limit"":10
               }
            ]
         }
      },
      {
         ""id"":8660006349418736,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""scatterplot"",
            ""requests"":{
               ""x"":{
                  ""q"":""avg:system.cpu.user{*} by {service, account}"",
                  ""aggregator"":""max""
               },
               ""y"":{
                  ""q"":""avg:system.mem.used{*} by {service, account}"",
                  ""aggregator"":""min""
               }
            },
            ""xaxis"":{
               ""scale"":""pow"",
               ""label"":""x"",
               ""include_zero"":true,
               ""min"":""1"",
               ""max"":""2000""
            },
            ""yaxis"":{
               ""scale"":""log"",
               ""label"":""y"",
               ""include_zero"":false,
               ""min"":""5"",
               ""max"":""2222""
            },
            ""color_by_groups"":[
               ""account"",
               ""apm-role-group""
            ]
         }
      },
      {
         ""id"":1669590772917638,
         ""definition"":{
            ""title"":""env: prod, datacenter:dc1, service: master-db"",
            ""title_size"":""16"",
            ""title_align"":""left"",
            ""type"":""servicemap"",
            ""service"":""master-db"",
            ""filters"":[
               ""env:prod"",
               ""datacenter:dc1""
            ]
         }
      },
      {
         ""id"":2138829058361817,
         ""definition"":{
            ""title"":""Widget Title"",
            ""show_legend"":true,
            ""legend_size"":""2"",
            ""type"":""timeseries"",
            ""requests"":[
               {
                  ""q"":""avg:system.cpu.user{app:general} by {env}"",
                  ""on_right_yaxis"":false,
                  ""metadata"":[
                     {
                        ""expression"":""avg:system.cpu.user{app:general} by {env}"",
                        ""alias_name"":""Alpha""
                     }
                  ],
                  ""style"":{
                     ""palette"":""warm"",
                     ""line_type"":""dashed"",
                     ""line_width"":""thin""
                  },
                  ""display_type"":""line""
               },
               {
                  ""on_right_yaxis"":false,
                  ""log_query"":{
                     ""index"":""mcnulty"",
                     ""search"":{
                        ""query"":""status:info""
                     },
                     ""group_by"":[
                        {
                           ""facet"":""host"",
                           ""sort"":{
                              ""facet"":""@duration"",
                              ""aggregation"":""avg"",
                              ""order"":""desc""
                           },
                           ""limit"":10
                        }
                     ],
                     ""compute"":{
                        ""facet"":""@duration"",
                        ""interval"":5000,
                        ""aggregation"":""avg""
                     }
                  },
                  ""display_type"":""area""
               },
               {
                  ""on_right_yaxis"":false,
                  ""apm_query"":{
                     ""index"":""apm-search"",
                     ""search"":{
                        ""query"":""type:web""
                     },
                     ""group_by"":[
                        {
                           ""facet"":""resource_name"",
                           ""sort"":{
                              ""facet"":""@string_query.interval"",
                              ""aggregation"":""avg"",
                              ""order"":""desc""
                           },
                           ""limit"":50
                        }
                     ],
                     ""compute"":{
                        ""facet"":""@duration"",
                        ""interval"":5000,
                        ""aggregation"":""avg""
                     }
                  },
                  ""display_type"":""bars""
               },
               {
                  ""on_right_yaxis"":false,
                  ""process_query"":{
                     ""search_by"":""error"",
                     ""metric"":""process.stat.cpu.total_pct"",
                     ""limit"":50,
                     ""filter_by"":[
                        ""active""
                     ]
                  },
                  ""display_type"":""area""
               }
            ],
            ""yaxis"":{
               ""scale"":""log"",
               ""include_zero"":false,
               ""max"":""100""
            },
            ""events"":[
               {
                  ""q"":""sources:test tags:1""
               },
               {
                  ""q"":""sources:test tags:2""
               }
            ],
            ""markers"":[
               {
                  ""label"":"" z=6 "",
                  ""value"":""y = 4"",
                  ""display_type"":""error dashed""
               },
               {
                  ""label"":"" x=8 "",
                  ""value"":""10 < y < 999"",
                  ""display_type"":""ok solid""
               }
            ]
         }
      },
      {
         ""id"":7307171374656551,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""toplist"",
            ""requests"":[
               {
                  ""q"":""avg:system.cpu.user{app:general} by {env}"",
                  ""conditional_formats"":[
                     {
                        ""hide_value"":false,
                        ""comparator"":""<"",
                        ""palette"":""white_on_green"",
                        ""value"":2
                     },
                     {
                        ""hide_value"":false,
                        ""comparator"":"">"",
                        ""palette"":""white_on_red"",
                        ""value"":2.2
                     }
                  ]
               }
            ]
         }
      },
      {
         ""id"":7086674838553258,
         ""definition"":{
            ""title"":""Group Widget"",
            ""type"":""group"",
            ""layout_type"":""ordered"",
            ""widgets"":[
               {
                  ""id"":3726092277657502,
                  ""definition"":{
                     ""type"":""note"",
                     ""content"":""cluster note widget"",
                     ""background_color"":""pink"",
                     ""font_size"":""14"",
                     ""text_align"":""center"",
                     ""show_tick"":true,
                     ""tick_pos"":""50%"",
                     ""tick_edge"":""left""
                  }
               },
               {
                  ""id"":6376384650558057,
                  ""definition"":{
                     ""title"":""Alert Graph"",
                     ""type"":""alert_graph"",
                     ""alert_id"":""123"",
                     ""viz_type"":""toplist""
                  }
               }
            ]
         }
      },
      {
         ""id"":4668903563678912,
         ""definition"":{
            ""title"":""Widget Title"",
            ""type"":""slo"",
            ""view_type"":""detail"",
            ""time_windows"":[
               ""7d"",
               ""previous_week""
            ],
            ""slo_id"":""56789"",
            ""show_error_budget"":true,
            ""view_mode"":""overall"",
            ""global_time_target"":""0""
         }
      }
   ],
   ""template_variables"":[
      {
         ""name"":""var_1"",
         ""default"":""aws"",
         ""prefix"":""host""
      },
      {
         ""name"":""var_2"",
         ""default"":""autoscaling"",
         ""prefix"":""service_name""
      }
   ],
   ""layout_type"":""ordered"",
   ""is_read_only"":true,
   ""notify_list"":[

   ],
   ""template_variable_presets"":[
      {
         ""name"":""preset_1"",
         ""template_variables"":[
            {
               ""name"":""var_1"",
               ""value"":""host.dc""
            },
            {
               ""name"":""var_2"",
               ""value"":""my_service""
            }
         ]
      }
   ]
}
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.DashboardJson;
import com.pulumi.datadog.DashboardJsonArgs;
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) {
        // Example Dashboard JSON
        var dashboardJson = new DashboardJson("dashboardJson", DashboardJsonArgs.builder()
            .dashboard("""
{
   "title":"Ordered Layout Dashboard",
   "description":"Created using the Datadog provider in Pulumi",
   "widgets":[
      {
         "id":719369537777170,
         "definition":{
            "title":"Widget Title",
            "type":"alert_graph",
            "alert_id":"895605",
            "viz_type":"timeseries"
         }
      },
      {
         "id":2306240030393868,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":6990998850881326,
         "definition":{
            "title":"Widget Title",
            "type":"alert_value",
            "alert_id":"895605",
            "unit":"b",
            "text_align":"center",
            "precision":3
         }
      },
      {
         "id":3351284044659007,
         "definition":{
            "title":"Widget Title",
            "type":"change",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "compare_to":"week_before",
                  "change_type":"absolute",
                  "order_dir":"desc",
                  "increase_good":true,
                  "order_by":"name",
                  "show_present":true
               }
            ]
         }
      },
      {
         "id":6450290622996182,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"distribution",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":4902842646291536,
         "definition":{
            "title":"Widget Title",
            "type":"check_status",
            "check":"aws.ecs.agent_connected",
            "grouping":"cluster",
            "group_by":[
               "account",
               "cluster"
            ],
            "tags":[
               "account:demo",
               "cluster:awseb-ruthebdog-env-8-dn3m6u3gvk"
            ]
         }
      },
      {
         "id":6392349954822644,
         "definition":{
            "title":"Widget Title",
            "show_legend":false,
            "type":"heatmap",
            "yaxis":{
               "scale":"sqrt",
               "include_zero":true,
               "min":"1",
               "max":"2"
            },
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "style":{
                     "palette":"warm"
                  }
               }
            ]
         }
      },
      {
         "id":5222961478940988,
         "definition":{
            "title":"Widget Title",
            "type":"hostmap",
            "requests":{
               "fill":{
                  "q":"avg:system.load.1{*} by {host}"
               },
               "size":{
                  "q":"avg:memcache.uptime{*} by {host}"
               }
            },
            "node_type":"container",
            "no_metric_hosts":true,
            "no_group_hosts":true,
            "group":[
               "host",
               "region"
            ],
            "scope":[
               "region:us-east-1",
               "aws_account:727006795293"
            ],
            "style":{
               "palette":"yellow_to_green",
               "palette_flip":true,
               "fill_min":"10",
               "fill_max":"20"
            }
         }
      },
      {
         "id":8121199734227072,
         "definition":{
            "type":"note",
            "content":"note text",
            "background_color":"pink",
            "font_size":"14",
            "text_align":"center",
            "show_tick":true,
            "tick_pos":"50%",
            "tick_edge":"left"
         }
      },
      {
         "id":1775856835833038,
         "definition":{
            "title":"Widget Title",
            "type":"query_value",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ],
            "autoscale":true,
            "custom_unit":"xx",
            "text_align":"right",
            "precision":4
         }
      },
      {
         "id":8461455966625581,
         "definition":{
            "title":"Widget Title",
            "type":"query_table",
            "requests":[
               {
                  "q":"avg:system.load.1{env:staging} by {account}",
                  "aggregator":"sum",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ],
                  "limit":10
               }
            ]
         }
      },
      {
         "id":8660006349418736,
         "definition":{
            "title":"Widget Title",
            "type":"scatterplot",
            "requests":{
               "x":{
                  "q":"avg:system.cpu.user{*} by {service, account}",
                  "aggregator":"max"
               },
               "y":{
                  "q":"avg:system.mem.used{*} by {service, account}",
                  "aggregator":"min"
               }
            },
            "xaxis":{
               "scale":"pow",
               "label":"x",
               "include_zero":true,
               "min":"1",
               "max":"2000"
            },
            "yaxis":{
               "scale":"log",
               "label":"y",
               "include_zero":false,
               "min":"5",
               "max":"2222"
            },
            "color_by_groups":[
               "account",
               "apm-role-group"
            ]
         }
      },
      {
         "id":1669590772917638,
         "definition":{
            "title":"env: prod, datacenter:dc1, service: master-db",
            "title_size":"16",
            "title_align":"left",
            "type":"servicemap",
            "service":"master-db",
            "filters":[
               "env:prod",
               "datacenter:dc1"
            ]
         }
      },
      {
         "id":2138829058361817,
         "definition":{
            "title":"Widget Title",
            "show_legend":true,
            "legend_size":"2",
            "type":"timeseries",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "on_right_yaxis":false,
                  "metadata":[
                     {
                        "expression":"avg:system.cpu.user{app:general} by {env}",
                        "alias_name":"Alpha"
                     }
                  ],
                  "style":{
                     "palette":"warm",
                     "line_type":"dashed",
                     "line_width":"thin"
                  },
                  "display_type":"line"
               },
               {
                  "on_right_yaxis":false,
                  "log_query":{
                     "index":"mcnulty",
                     "search":{
                        "query":"status:info"
                     },
                     "group_by":[
                        {
                           "facet":"host",
                           "sort":{
                              "facet":"@duration",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":10
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"area"
               },
               {
                  "on_right_yaxis":false,
                  "apm_query":{
                     "index":"apm-search",
                     "search":{
                        "query":"type:web"
                     },
                     "group_by":[
                        {
                           "facet":"resource_name",
                           "sort":{
                              "facet":"@string_query.interval",
                              "aggregation":"avg",
                              "order":"desc"
                           },
                           "limit":50
                        }
                     ],
                     "compute":{
                        "facet":"@duration",
                        "interval":5000,
                        "aggregation":"avg"
                     }
                  },
                  "display_type":"bars"
               },
               {
                  "on_right_yaxis":false,
                  "process_query":{
                     "search_by":"error",
                     "metric":"process.stat.cpu.total_pct",
                     "limit":50,
                     "filter_by":[
                        "active"
                     ]
                  },
                  "display_type":"area"
               }
            ],
            "yaxis":{
               "scale":"log",
               "include_zero":false,
               "max":"100"
            },
            "events":[
               {
                  "q":"sources:test tags:1"
               },
               {
                  "q":"sources:test tags:2"
               }
            ],
            "markers":[
               {
                  "label":" z=6 ",
                  "value":"y = 4",
                  "display_type":"error dashed"
               },
               {
                  "label":" x=8 ",
                  "value":"10 < y < 999",
                  "display_type":"ok solid"
               }
            ]
         }
      },
      {
         "id":7307171374656551,
         "definition":{
            "title":"Widget Title",
            "type":"toplist",
            "requests":[
               {
                  "q":"avg:system.cpu.user{app:general} by {env}",
                  "conditional_formats":[
                     {
                        "hide_value":false,
                        "comparator":"<",
                        "palette":"white_on_green",
                        "value":2
                     },
                     {
                        "hide_value":false,
                        "comparator":">",
                        "palette":"white_on_red",
                        "value":2.2
                     }
                  ]
               }
            ]
         }
      },
      {
         "id":7086674838553258,
         "definition":{
            "title":"Group Widget",
            "type":"group",
            "layout_type":"ordered",
            "widgets":[
               {
                  "id":3726092277657502,
                  "definition":{
                     "type":"note",
                     "content":"cluster note widget",
                     "background_color":"pink",
                     "font_size":"14",
                     "text_align":"center",
                     "show_tick":true,
                     "tick_pos":"50%",
                     "tick_edge":"left"
                  }
               },
               {
                  "id":6376384650558057,
                  "definition":{
                     "title":"Alert Graph",
                     "type":"alert_graph",
                     "alert_id":"123",
                     "viz_type":"toplist"
                  }
               }
            ]
         }
      },
      {
         "id":4668903563678912,
         "definition":{
            "title":"Widget Title",
            "type":"slo",
            "view_type":"detail",
            "time_windows":[
               "7d",
               "previous_week"
            ],
            "slo_id":"56789",
            "show_error_budget":true,
            "view_mode":"overall",
            "global_time_target":"0"
         }
      }
   ],
   "template_variables":[
      {
         "name":"var_1",
         "default":"aws",
         "prefix":"host"
      },
      {
         "name":"var_2",
         "default":"autoscaling",
         "prefix":"service_name"
      }
   ],
   "layout_type":"ordered",
   "is_read_only":true,
   "notify_list":[

   ],
   "template_variable_presets":[
      {
         "name":"preset_1",
         "template_variables":[
            {
               "name":"var_1",
               "value":"host.dc"
            },
            {
               "name":"var_2",
               "value":"my_service"
            }
         ]
      }
   ]
}
            """)
            .build());

    }
}
Copy
resources:
  # Example Dashboard JSON
  dashboardJson:
    type: datadog:DashboardJson
    name: dashboard_json
    properties:
      dashboard: |
        {
           "title":"Ordered Layout Dashboard",
           "description":"Created using the Datadog provider in Pulumi",
           "widgets":[
              {
                 "id":719369537777170,
                 "definition":{
                    "title":"Widget Title",
                    "type":"alert_graph",
                    "alert_id":"895605",
                    "viz_type":"timeseries"
                 }
              },
              {
                 "id":2306240030393868,
                 "definition":{
                    "title":"Widget Title",
                    "type":"alert_value",
                    "alert_id":"895605",
                    "unit":"b",
                    "text_align":"center",
                    "precision":3
                 }
              },
              {
                 "id":6990998850881326,
                 "definition":{
                    "title":"Widget Title",
                    "type":"alert_value",
                    "alert_id":"895605",
                    "unit":"b",
                    "text_align":"center",
                    "precision":3
                 }
              },
              {
                 "id":3351284044659007,
                 "definition":{
                    "title":"Widget Title",
                    "type":"change",
                    "requests":[
                       {
                          "q":"avg:system.load.1{env:staging} by {account}",
                          "compare_to":"week_before",
                          "change_type":"absolute",
                          "order_dir":"desc",
                          "increase_good":true,
                          "order_by":"name",
                          "show_present":true
                       }
                    ]
                 }
              },
              {
                 "id":6450290622996182,
                 "definition":{
                    "title":"Widget Title",
                    "show_legend":false,
                    "type":"distribution",
                    "requests":[
                       {
                          "q":"avg:system.load.1{env:staging} by {account}",
                          "style":{
                             "palette":"warm"
                          }
                       }
                    ]
                 }
              },
              {
                 "id":4902842646291536,
                 "definition":{
                    "title":"Widget Title",
                    "type":"check_status",
                    "check":"aws.ecs.agent_connected",
                    "grouping":"cluster",
                    "group_by":[
                       "account",
                       "cluster"
                    ],
                    "tags":[
                       "account:demo",
                       "cluster:awseb-ruthebdog-env-8-dn3m6u3gvk"
                    ]
                 }
              },
              {
                 "id":6392349954822644,
                 "definition":{
                    "title":"Widget Title",
                    "show_legend":false,
                    "type":"heatmap",
                    "yaxis":{
                       "scale":"sqrt",
                       "include_zero":true,
                       "min":"1",
                       "max":"2"
                    },
                    "requests":[
                       {
                          "q":"avg:system.load.1{env:staging} by {account}",
                          "style":{
                             "palette":"warm"
                          }
                       }
                    ]
                 }
              },
              {
                 "id":5222961478940988,
                 "definition":{
                    "title":"Widget Title",
                    "type":"hostmap",
                    "requests":{
                       "fill":{
                          "q":"avg:system.load.1{*} by {host}"
                       },
                       "size":{
                          "q":"avg:memcache.uptime{*} by {host}"
                       }
                    },
                    "node_type":"container",
                    "no_metric_hosts":true,
                    "no_group_hosts":true,
                    "group":[
                       "host",
                       "region"
                    ],
                    "scope":[
                       "region:us-east-1",
                       "aws_account:727006795293"
                    ],
                    "style":{
                       "palette":"yellow_to_green",
                       "palette_flip":true,
                       "fill_min":"10",
                       "fill_max":"20"
                    }
                 }
              },
              {
                 "id":8121199734227072,
                 "definition":{
                    "type":"note",
                    "content":"note text",
                    "background_color":"pink",
                    "font_size":"14",
                    "text_align":"center",
                    "show_tick":true,
                    "tick_pos":"50%",
                    "tick_edge":"left"
                 }
              },
              {
                 "id":1775856835833038,
                 "definition":{
                    "title":"Widget Title",
                    "type":"query_value",
                    "requests":[
                       {
                          "q":"avg:system.load.1{env:staging} by {account}",
                          "aggregator":"sum",
                          "conditional_formats":[
                             {
                                "hide_value":false,
                                "comparator":"<",
                                "palette":"white_on_green",
                                "value":2
                             },
                             {
                                "hide_value":false,
                                "comparator":">",
                                "palette":"white_on_red",
                                "value":2.2
                             }
                          ]
                       }
                    ],
                    "autoscale":true,
                    "custom_unit":"xx",
                    "text_align":"right",
                    "precision":4
                 }
              },
              {
                 "id":8461455966625581,
                 "definition":{
                    "title":"Widget Title",
                    "type":"query_table",
                    "requests":[
                       {
                          "q":"avg:system.load.1{env:staging} by {account}",
                          "aggregator":"sum",
                          "conditional_formats":[
                             {
                                "hide_value":false,
                                "comparator":"<",
                                "palette":"white_on_green",
                                "value":2
                             },
                             {
                                "hide_value":false,
                                "comparator":">",
                                "palette":"white_on_red",
                                "value":2.2
                             }
                          ],
                          "limit":10
                       }
                    ]
                 }
              },
              {
                 "id":8660006349418736,
                 "definition":{
                    "title":"Widget Title",
                    "type":"scatterplot",
                    "requests":{
                       "x":{
                          "q":"avg:system.cpu.user{*} by {service, account}",
                          "aggregator":"max"
                       },
                       "y":{
                          "q":"avg:system.mem.used{*} by {service, account}",
                          "aggregator":"min"
                       }
                    },
                    "xaxis":{
                       "scale":"pow",
                       "label":"x",
                       "include_zero":true,
                       "min":"1",
                       "max":"2000"
                    },
                    "yaxis":{
                       "scale":"log",
                       "label":"y",
                       "include_zero":false,
                       "min":"5",
                       "max":"2222"
                    },
                    "color_by_groups":[
                       "account",
                       "apm-role-group"
                    ]
                 }
              },
              {
                 "id":1669590772917638,
                 "definition":{
                    "title":"env: prod, datacenter:dc1, service: master-db",
                    "title_size":"16",
                    "title_align":"left",
                    "type":"servicemap",
                    "service":"master-db",
                    "filters":[
                       "env:prod",
                       "datacenter:dc1"
                    ]
                 }
              },
              {
                 "id":2138829058361817,
                 "definition":{
                    "title":"Widget Title",
                    "show_legend":true,
                    "legend_size":"2",
                    "type":"timeseries",
                    "requests":[
                       {
                          "q":"avg:system.cpu.user{app:general} by {env}",
                          "on_right_yaxis":false,
                          "metadata":[
                             {
                                "expression":"avg:system.cpu.user{app:general} by {env}",
                                "alias_name":"Alpha"
                             }
                          ],
                          "style":{
                             "palette":"warm",
                             "line_type":"dashed",
                             "line_width":"thin"
                          },
                          "display_type":"line"
                       },
                       {
                          "on_right_yaxis":false,
                          "log_query":{
                             "index":"mcnulty",
                             "search":{
                                "query":"status:info"
                             },
                             "group_by":[
                                {
                                   "facet":"host",
                                   "sort":{
                                      "facet":"@duration",
                                      "aggregation":"avg",
                                      "order":"desc"
                                   },
                                   "limit":10
                                }
                             ],
                             "compute":{
                                "facet":"@duration",
                                "interval":5000,
                                "aggregation":"avg"
                             }
                          },
                          "display_type":"area"
                       },
                       {
                          "on_right_yaxis":false,
                          "apm_query":{
                             "index":"apm-search",
                             "search":{
                                "query":"type:web"
                             },
                             "group_by":[
                                {
                                   "facet":"resource_name",
                                   "sort":{
                                      "facet":"@string_query.interval",
                                      "aggregation":"avg",
                                      "order":"desc"
                                   },
                                   "limit":50
                                }
                             ],
                             "compute":{
                                "facet":"@duration",
                                "interval":5000,
                                "aggregation":"avg"
                             }
                          },
                          "display_type":"bars"
                       },
                       {
                          "on_right_yaxis":false,
                          "process_query":{
                             "search_by":"error",
                             "metric":"process.stat.cpu.total_pct",
                             "limit":50,
                             "filter_by":[
                                "active"
                             ]
                          },
                          "display_type":"area"
                       }
                    ],
                    "yaxis":{
                       "scale":"log",
                       "include_zero":false,
                       "max":"100"
                    },
                    "events":[
                       {
                          "q":"sources:test tags:1"
                       },
                       {
                          "q":"sources:test tags:2"
                       }
                    ],
                    "markers":[
                       {
                          "label":" z=6 ",
                          "value":"y = 4",
                          "display_type":"error dashed"
                       },
                       {
                          "label":" x=8 ",
                          "value":"10 < y < 999",
                          "display_type":"ok solid"
                       }
                    ]
                 }
              },
              {
                 "id":7307171374656551,
                 "definition":{
                    "title":"Widget Title",
                    "type":"toplist",
                    "requests":[
                       {
                          "q":"avg:system.cpu.user{app:general} by {env}",
                          "conditional_formats":[
                             {
                                "hide_value":false,
                                "comparator":"<",
                                "palette":"white_on_green",
                                "value":2
                             },
                             {
                                "hide_value":false,
                                "comparator":">",
                                "palette":"white_on_red",
                                "value":2.2
                             }
                          ]
                       }
                    ]
                 }
              },
              {
                 "id":7086674838553258,
                 "definition":{
                    "title":"Group Widget",
                    "type":"group",
                    "layout_type":"ordered",
                    "widgets":[
                       {
                          "id":3726092277657502,
                          "definition":{
                             "type":"note",
                             "content":"cluster note widget",
                             "background_color":"pink",
                             "font_size":"14",
                             "text_align":"center",
                             "show_tick":true,
                             "tick_pos":"50%",
                             "tick_edge":"left"
                          }
                       },
                       {
                          "id":6376384650558057,
                          "definition":{
                             "title":"Alert Graph",
                             "type":"alert_graph",
                             "alert_id":"123",
                             "viz_type":"toplist"
                          }
                       }
                    ]
                 }
              },
              {
                 "id":4668903563678912,
                 "definition":{
                    "title":"Widget Title",
                    "type":"slo",
                    "view_type":"detail",
                    "time_windows":[
                       "7d",
                       "previous_week"
                    ],
                    "slo_id":"56789",
                    "show_error_budget":true,
                    "view_mode":"overall",
                    "global_time_target":"0"
                 }
              }
           ],
           "template_variables":[
              {
                 "name":"var_1",
                 "default":"aws",
                 "prefix":"host"
              },
              {
                 "name":"var_2",
                 "default":"autoscaling",
                 "prefix":"service_name"
              }
           ],
           "layout_type":"ordered",
           "is_read_only":true,
           "notify_list":[

           ],
           "template_variable_presets":[
              {
                 "name":"preset_1",
                 "template_variables":[
                    {
                       "name":"var_1",
                       "value":"host.dc"
                    },
                    {
                       "name":"var_2",
                       "value":"my_service"
                    }
                 ]
              }
           ]
        }        
Copy

Create DashboardJson Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DashboardJson(name: string, args: DashboardJsonArgs, opts?: CustomResourceOptions);
@overload
def DashboardJson(resource_name: str,
                  args: DashboardJsonArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def DashboardJson(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  dashboard: Optional[str] = None,
                  dashboard_lists: Optional[Sequence[int]] = None,
                  url: Optional[str] = None)
func NewDashboardJson(ctx *Context, name string, args DashboardJsonArgs, opts ...ResourceOption) (*DashboardJson, error)
public DashboardJson(string name, DashboardJsonArgs args, CustomResourceOptions? opts = null)
public DashboardJson(String name, DashboardJsonArgs args)
public DashboardJson(String name, DashboardJsonArgs args, CustomResourceOptions options)
type: datadog:DashboardJson
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DashboardJsonArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DashboardJsonArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DashboardJsonArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DashboardJsonArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DashboardJsonArgs
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 dashboardJsonResource = new Datadog.DashboardJson("dashboardJsonResource", new()
{
    Dashboard = "string",
    DashboardLists = new[]
    {
        0,
    },
    Url = "string",
});
Copy
example, err := datadog.NewDashboardJson(ctx, "dashboardJsonResource", &datadog.DashboardJsonArgs{
	Dashboard: pulumi.String("string"),
	DashboardLists: pulumi.IntArray{
		pulumi.Int(0),
	},
	Url: pulumi.String("string"),
})
Copy
var dashboardJsonResource = new DashboardJson("dashboardJsonResource", DashboardJsonArgs.builder()
    .dashboard("string")
    .dashboardLists(0)
    .url("string")
    .build());
Copy
dashboard_json_resource = datadog.DashboardJson("dashboardJsonResource",
    dashboard="string",
    dashboard_lists=[0],
    url="string")
Copy
const dashboardJsonResource = new datadog.DashboardJson("dashboardJsonResource", {
    dashboard: "string",
    dashboardLists: [0],
    url: "string",
});
Copy
type: datadog:DashboardJson
properties:
    dashboard: string
    dashboardLists:
        - 0
    url: string
Copy

DashboardJson 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 DashboardJson resource accepts the following input properties:

Dashboard This property is required. string
The JSON formatted definition of the Dashboard.
DashboardLists List<int>
Url string
The URL of the dashboard.
Dashboard This property is required. string
The JSON formatted definition of the Dashboard.
DashboardLists []int
Url string
The URL of the dashboard.
dashboard This property is required. String
The JSON formatted definition of the Dashboard.
dashboardLists List<Integer>
url String
The URL of the dashboard.
dashboard This property is required. string
The JSON formatted definition of the Dashboard.
dashboardLists number[]
url string
The URL of the dashboard.
dashboard This property is required. str
The JSON formatted definition of the Dashboard.
dashboard_lists Sequence[int]
url str
The URL of the dashboard.
dashboard This property is required. String
The JSON formatted definition of the Dashboard.
dashboardLists List<Number>
url String
The URL of the dashboard.

Outputs

All input properties are implicitly available as output properties. Additionally, the DashboardJson resource produces the following output properties:

DashboardListsRemoveds List<int>
The list of dashboard lists this dashboard should be removed from. Internal only.
Id string
The provider-assigned unique ID for this managed resource.
DashboardListsRemoveds []int
The list of dashboard lists this dashboard should be removed from. Internal only.
Id string
The provider-assigned unique ID for this managed resource.
dashboardListsRemoveds List<Integer>
The list of dashboard lists this dashboard should be removed from. Internal only.
id String
The provider-assigned unique ID for this managed resource.
dashboardListsRemoveds number[]
The list of dashboard lists this dashboard should be removed from. Internal only.
id string
The provider-assigned unique ID for this managed resource.
dashboard_lists_removeds Sequence[int]
The list of dashboard lists this dashboard should be removed from. Internal only.
id str
The provider-assigned unique ID for this managed resource.
dashboardListsRemoveds List<Number>
The list of dashboard lists this dashboard should be removed from. Internal only.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing DashboardJson Resource

Get an existing DashboardJson 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?: DashboardJsonState, opts?: CustomResourceOptions): DashboardJson
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dashboard: Optional[str] = None,
        dashboard_lists: Optional[Sequence[int]] = None,
        dashboard_lists_removeds: Optional[Sequence[int]] = None,
        url: Optional[str] = None) -> DashboardJson
func GetDashboardJson(ctx *Context, name string, id IDInput, state *DashboardJsonState, opts ...ResourceOption) (*DashboardJson, error)
public static DashboardJson Get(string name, Input<string> id, DashboardJsonState? state, CustomResourceOptions? opts = null)
public static DashboardJson get(String name, Output<String> id, DashboardJsonState state, CustomResourceOptions options)
resources:  _:    type: datadog:DashboardJson    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Dashboard string
The JSON formatted definition of the Dashboard.
DashboardLists List<int>
DashboardListsRemoveds List<int>
The list of dashboard lists this dashboard should be removed from. Internal only.
Url string
The URL of the dashboard.
Dashboard string
The JSON formatted definition of the Dashboard.
DashboardLists []int
DashboardListsRemoveds []int
The list of dashboard lists this dashboard should be removed from. Internal only.
Url string
The URL of the dashboard.
dashboard String
The JSON formatted definition of the Dashboard.
dashboardLists List<Integer>
dashboardListsRemoveds List<Integer>
The list of dashboard lists this dashboard should be removed from. Internal only.
url String
The URL of the dashboard.
dashboard string
The JSON formatted definition of the Dashboard.
dashboardLists number[]
dashboardListsRemoveds number[]
The list of dashboard lists this dashboard should be removed from. Internal only.
url string
The URL of the dashboard.
dashboard str
The JSON formatted definition of the Dashboard.
dashboard_lists Sequence[int]
dashboard_lists_removeds Sequence[int]
The list of dashboard lists this dashboard should be removed from. Internal only.
url str
The URL of the dashboard.
dashboard String
The JSON formatted definition of the Dashboard.
dashboardLists List<Number>
dashboardListsRemoveds List<Number>
The list of dashboard lists this dashboard should be removed from. Internal only.
url String
The URL of the dashboard.

Import

$ pulumi import datadog:index/dashboardJson:DashboardJson my_service_dashboard sv7-gyh-kas
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.