Google Cloud (Stackdriver) Monitoring Custom Service

This page shows how to write Terraform for Cloud (Stackdriver) Monitoring Custom Service and write them securely.

google_monitoring_custom_service (Terraform)

The Custom Service in Cloud (Stackdriver) Monitoring can be configured in Terraform with the resource name google_monitoring_custom_service. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "google_monitoring_custom_service" "service" {
  service_id   = var.service_name
  display_name = var.service_name
  project      = var.project
}
main.tf#L1
resource "google_monitoring_custom_service" "service" {
  service_id   = var.service_name
  display_name = var.service_name
  project      = var.project
}
main.tf#L1
resource "google_monitoring_custom_service" "service" {
  service_id   = var.service_name
  display_name = var.service_name
  project      = var.project
}
main.tf#L7
resource "google_monitoring_custom_service" "this" {
  display_name = var.display_name
  project      = var.project
  service_id   = var.service_id

  dynamic "telemetry" {
custom_service.tf#L7
resource "google_monitoring_custom_service" "terraform-service" {
  service_id = "terraform-service"
  display_name = "Service Created by Terraform"
}

resource "google_monitoring_slo" "window_based_slo" {

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

Name used for UI elements listing this Service.

  • id optional computed - string
  • name optional computed - string

The full resource name for this service. The syntax is: projects/[PROJECT_ID]/services/[SERVICE_ID].

An optional service ID to use. If not given, the server will generate a service ID.

Explanation in Terraform Registry

A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern (Wikipedia). In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible To get more information about Service, see:

Frequently asked questions

What is Google Cloud (Stackdriver) Monitoring Custom Service?

Google Cloud (Stackdriver) Monitoring Custom Service 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 Custom Service?

For Terraform, the google/exposure-notifications-verification-server, wcraymann/K-State_PITS_AGENP and wcraymann/K-State_PITS_AGENP 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.