Skip to content

googleMonitoringDashboard

A Google Stackdriver dashboard. Dashboards define the content and layout of pages in the Stackdriver web application.

To get more information about Dashboards, see:

Example Usage - Monitoring Dashboard Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.monitoringDashboard.MonitoringDashboard(this, "dashboard", {
  dashboard_json:
    '{\n  "displayName": "Demo Dashboard",\n  "gridLayout": {\n    "widgets": [\n      {\n        "blank": {}\n      }\n    ]\n  }\n}\n\n',
});

Example Usage - Monitoring Dashboard GridLayout

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.monitoringDashboard.MonitoringDashboard(this, "dashboard", {
  dashboard_json:
    '{\n  "displayName": "Grid Layout Example",\n  "gridLayout": {\n    "columns": "2",\n    "widgets": [\n      {\n        "title": "Widget 1",\n        "xyChart": {\n          "dataSets": [{\n            "timeSeriesQuery": {\n              "timeSeriesFilter": {\n                "filter": "metric.type=\\"agent.googleapis.com/nginx/connections/accepted_count\\"",\n                "aggregation": {\n                  "perSeriesAligner": "ALIGN_RATE"\n                }\n              },\n              "unitOverride": "1"\n            },\n            "plotType": "LINE"\n          }],\n          "timeshiftDuration": "0s",\n          "yAxis": {\n            "label": "y1Axis",\n            "scale": "LINEAR"\n          }\n        }\n      },\n      {\n        "text": {\n          "content": "Widget 2",\n          "format": "MARKDOWN"\n        }\n      },\n      {\n        "title": "Widget 3",\n        "xyChart": {\n          "dataSets": [{\n            "timeSeriesQuery": {\n              "timeSeriesFilter": {\n                "filter": "metric.type=\\"agent.googleapis.com/nginx/connections/accepted_count\\"",\n                "aggregation": {\n                  "perSeriesAligner": "ALIGN_RATE"\n                }\n              },\n              "unitOverride": "1"\n            },\n            "plotType": "STACKED_BAR"\n          }],\n          "timeshiftDuration": "0s",\n          "yAxis": {\n            "label": "y1Axis",\n            "scale": "LINEAR"\n          }\n        }\n      }\n    ]\n  }\n}\n\n',
});

Argument Reference

The following arguments are supported:

  • dashboardJson - (Required) The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards. The representation of an existing dashboard can be found by using the API Explorer

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{projectIdOrNumber}/dashboards/{dashboardId}

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

Import

Dashboard can be imported using any of these accepted formats:

$ terraform import google_monitoring_dashboard.default projects/{{project}}/dashboards/{{dashboard_id}}
$ terraform import google_monitoring_dashboard.default {{dashboard_id}}

User Project Overrides

This resource supports User Project Overrides.