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 = var.name-all-clusters
dashboard_json = templatefile(
"./dashboard-config.json",
{
CLIENTNAME = var.name-client,
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" {
Parameters
-
dashboard_json
required - string
The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.
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:
- API documentation
- How-to Guides
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.