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

dashboard.tf#L6
resource "google_monitoring_dashboard" "dashboard-per-cluster" {
  for_each = var.name-all-clusters
  dashboard_json = templatefile(
    "./dashboard-config.json",
    {
      CLIENTNAME  = var.name-client,
main.tf#L39
resource "google_monitoring_dashboard" "dashboard" {
  dashboard_json = file(var.dashboard_json_file)
  project        = var.project_id
}

output "project_id" {
main.tf#L39
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).

Parameters

The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.

  • 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.

security-icon

Automate config file reviews on your commits

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