A Google Stackdriver dashboard. Dashboards define the content and layout of pages in the Stackdriver web application.
To get more information about Dashboards, see:
resource "google_monitoring_dashboard" "dashboard" {
dashboard_json = <<EOF
{
"displayName": "Demo Dashboard",
"gridLayout": {
"widgets": [
{
"blank": {}
}
]
}
}
EOF
}
resource "google_monitoring_dashboard" "dashboard" {
dashboard_json = <<EOF
{
"displayName": "Grid Layout Example",
"gridLayout": {
"columns": "2",
"widgets": [
{
"title": "Widget 1",
"xyChart": {
"dataSets": [{
"timeSeriesQuery": {
"timeSeriesFilter": {
"filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
"aggregation": {
"perSeriesAligner": "ALIGN_RATE"
}
},
"unitOverride": "1"
},
"plotType": "LINE"
}],
"timeshiftDuration": "0s",
"yAxis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
},
{
"text": {
"content": "Widget 2",
"format": "MARKDOWN"
}
},
{
"title": "Widget 3",
"xyChart": {
"dataSets": [{
"timeSeriesQuery": {
"timeSeriesFilter": {
"filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
"aggregation": {
"perSeriesAligner": "ALIGN_RATE"
}
},
"unitOverride": "1"
},
"plotType": "STACKED_BAR"
}],
"timeshiftDuration": "0s",
"yAxis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
}
]
}
}
EOF
}
The following arguments are supported:
dashboard_json
-
(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
~> Warning: Because this is represented as a JSON string, Terraform doesn't have underlying information to know which fields in the string have defaults. To prevent permanent diffs from default values, Terraform will attempt to suppress diffs where the value is returned in the JSON string but doesn't exist in the configuration. Consequently, legitmate remove-only diffs will also be suppressed. For Terraform to detect the diff, key removals must also be accompanied by a non-removal change (trivial or not).
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{project_id_or_number}/dashboards/{dashboard_id}
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.Dashboard can be imported using any of these accepted formats:
projects/{{project}}/dashboards/{{dashboard_id}}
{{dashboard_id}}
In Terraform v1.5.0 and later, use an import
block to import Dashboard using one of the formats above. For example:
import {
id = "projects/{{project}}/dashboards/{{dashboard_id}}"
to = google_monitoring_dashboard.default
}
When using the terraform import
command, Dashboard can be imported using one of the formats above. For example:
$ terraform import google_monitoring_dashboard.default projects/{{project}}/dashboards/{{dashboard_id}}
$ terraform import google_monitoring_dashboard.default {{dashboard_id}}
This resource supports User Project Overrides.