Skip to content

googleMonitoringNotificationChannel

A NotificationChannel is a medium through which an alert is delivered when a policy violation is detected. Examples of channels include email, SMS, and third-party messaging applications. Fields containing sensitive information like authentication tokens or contact info are only partially populated on retrieval.

To get more information about NotificationChannel, see:

Example Usage - Notification Channel Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const dataGoogleMonitoringNotificationChannelBasic =
  new google.dataGoogleMonitoringNotificationChannel.DataGoogleMonitoringNotificationChannel(
    this,
    "basic",
    {
      display_name: "Test Notification Channel",
    }
  );
new google.monitoringAlertPolicy.MonitoringAlertPolicy(this, "alert_policy", {
  combiner: "OR",
  conditions: [
    {
      condition_threshold: [
        {
          aggregations: [
            {
              alignment_period: "60s",
              per_series_aligner: "ALIGN_RATE",
            },
          ],
          comparison: "COMPARISON_GT",
          duration: "60s",
          filter:
            'metric.type="compute.googleapis.com/instance/disk/write_bytes_count" AND resource.type="gce_instance"',
        },
      ],
      display_name: "test condition",
    },
  ],
  display_name: "My Alert Policy",
  notification_channels: [dataGoogleMonitoringNotificationChannelBasic.name],
});

Argument Reference

The arguments of this data source act as filters for querying the available notification channels. The given filters must match exactly one notification channel whose data will be exported as attributes. The following arguments are supported:

One of the following fields must be specified:

  • displayName - (Optional) The display name for this notification channel.

  • type - (Optional) The type of the notification channel.


Other optional fields include:

  • labels - (Optional) Labels (corresponding to the NotificationChannelDescriptor schema) to filter the notification channels by.

  • userLabels - (Optional) User-provided key-value labels to filter by.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • name - The full REST resource name for this channel. The syntax is: projects/[projectId]/notificationChannels/[channelId].

  • verificationStatus - Indicates whether this channel has been verified or not.

  • labels - Configuration fields that define the channel and its behavior.

  • userLabels - User-supplied key/value data that does not need to conform to the corresponding NotificationChannelDescriptor's schema, unlike the labels field.

  • description - An optional human-readable description of this notification channel.

  • enabled - Whether notifications are forwarded to the described channel.