Google Cloud (Stackdriver) Monitoring Dashboard

This page shows how to write Terraform for Cloud (Stackdriver) Monitoring Dashboard and write them securely.

google_monitoring_dashboard (Terraform)

The Dashboard in Cloud (Stackdriver) Monitoring can be configured in Terraform with the resource name google_monitoring_dashboard. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "google_monitoring_dashboard" "dashboard-per-cluster" {
  for_each =
  dashboard_json = templatefile(
      CLIENTNAME  =,
resource "google_monitoring_dashboard" "dashboard" {
  dashboard_json = file(var.dashboard_json_file)
  project        = var.project_id

output "project_id" {
resource "google_monitoring_dashboard" "dashboard" {
  dashboard_json = file(var.dashboard_json_file)
  project        = var.project_id

output "project_id" {

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


The JSON representation of a dashboard, following the format at

  • id optional computed - string
  • project optional computed - string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Explanation in Terraform Registry

A Google Stackdriver dashboard. Dashboards define the content and layout of pages in the Stackdriver web application. To get more information about Dashboards, see:

Frequently asked questions

What is Google Cloud (Stackdriver) Monitoring Dashboard?

Google Cloud (Stackdriver) Monitoring Dashboard is a resource for Cloud (Stackdriver) Monitoring of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud (Stackdriver) Monitoring Dashboard?

For Terraform, the sheryao-deloitte/git_tf_cicd, GoogleCloudPlatform/dataflow-sample-applications and GoogleCloudPlatform/monitoring-dashboard-samples source code examples are useful. See the Terraform Example section for further details.


Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.