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
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.
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).
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.
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".
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.
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
is_read_only is deprecated and has no effect — restricted_roles is the only supported way to lock editing permissions.
The widget block list is order-sensitive for ordered dashboards; reordering widgets in the Datadog UI outside of Terraform causes Terraform to detect drift and want to revert the order on the next apply.
dashboard_lists should not be set on the dashboard resource if you are also managing the same dashboard-list membership via a separate datadog_dashboard_list resource — doing both causes inconsistent/flapping state.
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?