Tool to fetch Datadog Dashboards and output an HCL representation of them to stdout.
Useful for managing Dashboard state in: TerraForm
go get github.com/promiseofcake/datadog-fetch-hcl
Ensure your Datadog API / APP keys are exported
export DATADOG_API_KEY=foo
export DATADOG_APP_KEY=bar
Run via the following, you can redirect to a .tf
file as you wish.
datadog-fetch-hcl -id <dashboard id> -title <resource title>
Hackery:
- Resource title is passed in via CLI, not pulled from the remote dashboard (due to HCL encoder limitations)
Missing features:
- Datadog events overlays
- Precision / Aggreation metrics
- Probably lots else