Currently, the Google Cloud Deployment Manager does not support deploying Cloud Monitoring dashboards natively. However, we can create a custom type provider with the dashboard API endpoint to get around it.
gcloud beta deployment-manager type-providers create monitoring-dashboardv1type \
--api-options-file=options.yaml \
--descriptor-url='https://monitoring.googleapis.com/$discovery/rest?version=v1'gcloud beta deployment-manager type-providers describe monitoring-dashboardv1type
Replace [PROJECT-ID] in dashboard.yaml with your GCP project id.
Replace [JSON-FILE] in dashboard.yaml with your json file.
Run the following command:
gcloud deployment-manager deployments create example-dashboard --config dashboard.yaml
https://console.cloud.google.com/monitoring/dashboards
gcloud deployment-manager deployments delete example-dashboard
gcloud beta deployment-manager type-providers delete monitoring-dashboardv1type