Create and manage Datadog dashboards as code using the datadog_dashboard Terraform resource

domain: registry.terraform.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Configure the DataDog/datadog Terraform provider with an API key and application key (for example via DD_API_KEY and DD_APP_KEY environment variables, or api_key/app_key provider arguments) rather than hardcoding credentials in .tf files.
  2. Define a datadog_dashboard resource with the two required top-level arguments: title (String) and layout_type (String, either "ordered" or "free"); add an optional description and tags (only team:<name> tags are supported).
  3. Add one or more widget blocks inside the resource, each containing exactly one nested *_definition block for the widget type you want (e.g. timeseries_definition, query_value_definition, alert_graph_definition, change_definition), with widget-specific required fields such as request/query blocks and a title.
  4. For ordered dashboards, optionally set reflow_type to "auto" (widgets have no explicit layout) or "fixed" (each widget must define its own layout) — reflow_type only applies when layout_type = "ordered".
  5. Use restricted_roles (a set of role UUIDs) to control who can edit the dashboard; do not use is_read_only, which is deprecated and non-functional.
  6. Run terraform plan and terraform apply; the resource's id becomes the Datadog dashboard ID, and dashboard_lists can optionally attach the dashboard to existing dashboard lists.

Known gotchas

Related routes

Create a RED method dashboard as code using the Grafana Terraform provider
registry.terraform.io · 6 steps · unrated
Manage Datadog Synthetic private locations at scale using the Terraform provider
docs.datadoghq.com/synthetics/platform/private_locations · 6 steps · unrated
Create and manage Datadog SLOs programmatically via the SLOs API
docs.datadoghq.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans