Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

terraform gce monitoring dashboard

I am getting unspecified resource in the dashboard when i create dashboard iwth terraform using this

 

 

resource "google_monitoring_dashboard" "dashboard" {
  dashboard_json = <<EOF
{
  "displayName": "Resource Monitoring Dashboard",
  "gridLayout": {
    "columns": 2,
    "widgets": [
      {
        "title": "CPU Utilization",
        "xyChart": {
          "dataSets": [{
            "timeSeriesQuery": {
              "timeSeriesFilter": {
                "filter": "metric.type=\"compute.googleapis.com/instance/cpu/utilization\" AND resource.type=\"gce_instance\"",
                "aggregation": {
                  "perSeriesAligner": "ALIGN_MEAN"
                }
              },
              "unitOverride": "%"
            },
            "plotType": "LINE"
          }],
          "timeshiftDuration": "0s",
          "yAxis": {
            "label": "CPU Utilization",
            "scale": "LINEAR"
          }
        }
      },
      {
        "title": "Disk Read Bytes",
        "xyChart": {
          "dataSets": [{
            "timeSeriesQuery": {
              "timeSeriesFilter": {
                "filter": "metric.type=\"compute.googleapis.com/instance/disk/read_bytes_count\" AND resource.type=\"gce_instance\"",
                "aggregation": {
                  "perSeriesAligner": "ALIGN_RATE"
                }
              },
              "unitOverride": "By/s"
            },
            "plotType": "LINE"
          }],
          "timeshiftDuration": "0s",
          "yAxis": {
            "label": "Disk Read Bytes",
            "scale": "LINEAR"
          }
        }
      },
      {
        "title": "Disk Write Bytes",
        "xyChart": {
          "dataSets": [{
            "timeSeriesQuery": {
              "timeSeriesFilter": {
                "filter": "metric.type=\"compute.googleapis.com/instance/disk/write_bytes_count\" AND resource.type=\"gce_instance\"",
                "aggregation": {
                  "perSeriesAligner": "ALIGN_RATE"
                }
              },
              "unitOverride": "By/s"
            },
            "plotType": "STACKED_BAR"
          }],
          "timeshiftDuration": "0s",
          "yAxis": {
            "label": "Disk Write Bytes",
            "scale": "LINEAR"
          }
        }
      }
    ]
  }
}
EOF
}

 

any idea why?  

2 2 242