# Examples of creating dashboards using terraform and the dynatrace\_document

**URL:** <https://community.dynatrace.com/t/examples-of-creating-dashboards-using-terraform-and-the-dynatrace-document/47174>\
**Category:** Dashboarding\
**Tags:** terraform, dashboards\
**Created:** [August 16, 2024, 9:17am UTC](https://community.dynatrace.com/t/examples-of-creating-dashboards-using-terraform-and-the-dynatrace-document/47174 "2024-08-16T09:17:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlbertY](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AlbertY](https://community.dynatrace.com/u/AlbertY)\
**Post date:** [August 16, 2024, 9:17am UTC](https://community.dynatrace.com/t/examples-of-creating-dashboards-using-terraform-and-the-dynatrace-document/47174/1 "2024-08-16T09:17:08Z")

</div>

Hello community,

I’m attempting to create dashboards using terraform (we arent going down the path of Monaco). I have been told in order to use the new dashboard app,&nbsp; I would have to use the dynatrace\_document which I believe I successfully have. I ensured that I had been using a service accound with all the document related policies. However when creating the dashboard, i am unable to find it on the UI.

I have a feeling it is something to do with sharing. My code is pretty simple.

resource “dynatrace\_document” “example\_dashboard\_v2” {type = "dashboard"name = "Example Dashboard v2"content = local.json\_data}and the json{“version”: 15,“variables”: [],“tiles”: {“1”: {“type”: “data”,“title”: “”,“query”: “fetch logs\n| limit 5”,“davis”: {“enabled”: false,“davisVisualization”: { “isAvailable”: true }},“visualization”: “table”,“visualizationSettings”: {“thresholds”: [],“chartSettings”: {“gapPolicy”: “connect”,“circleChartSettings”: {“groupingThresholdType”: “relative”,“groupingThresholdValue”: 0,“valueType”: “relative”},“categoryOverrides”: {}},“singleValue”: {“showLabel”: true,“label”: “”,“prefixIcon”: “”,“recordField”: “timestamp”,“autoscale”: true,“alignment”: “center”,“colorThresholdTarget”: “value”},“table”: {“rowDensity”: “condensed”,“enableSparklines”: false,“hiddenColumns”: [],“lineWrapIds”: [],“columnWidths”: {}},“honeycomb”: {“shape”: “hexagon”,“legend”: “auto”,“dataMappings”: { “value”: “timestamp” },“displayedFields”: [“content”],“colorMode”: “color-palette”,“colorPalette”: “categorical”},“histogram”: { “dataMappings”: [] }},“querySettings”: {“maxResultRecords”: 1000,“defaultScanLimitGbytes”: 500,“maxResultMegaBytes”: 1,“defaultSamplingRatio”: 10,“enableSampling”: false}}},“layouts”: { “1”: { “x”: 0, “y”: 0, “w”: 20, “h”: 6 } },“importedWithCode”: true}Does anyone have good examples of how to do this?

---

<div class="post-metadata">

**Author:** ![AlbertY](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AlbertY](https://community.dynatrace.com/u/AlbertY)\
**Post date:** [September 3, 2024, 11:30am UTC](https://community.dynatrace.com/t/examples-of-creating-dashboards-using-terraform-and-the-dynatrace-document/47174/2 "2024-09-03T11:30:29Z")

</div>

Managed to get the above working now. Essentially I was attempting to create dashboards using a service account (our companies pipelines to run the terraform apply) and we were unable to view the created dashboard.: To overcome this you are to add “private = false” in the resource.&nbsp; There was also a bug in the dynatrace terraform provider (which has been fixed in&nbsp; 1.65.0)&nbsp; to ensure that the private flag was fixed

---

<div class="post-metadata">

**Author:** ![bshah6](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@bshah6](https://community.dynatrace.com/u/bshah6)\
**Post date:** [April 2, 2025, 3:50pm UTC](https://community.dynatrace.com/t/examples-of-creating-dashboards-using-terraform-and-the-dynatrace-document/47174/3 "2025-04-02T15:50:08Z")

</div>

Should it be part of metadata?

“dashboardMetadata”: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “name”: var.dashboard\_name,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “shared”: true,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “owner”: var.owner\_email,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “private” = false,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “dashboardFilter”: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “timeframe”: “-30d to now”&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “popularity”: 1,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “hasConsistentColors”: false&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },
