MonitoringNotificationChannel


Property Value
Google Cloud Service Name Cloud Monitoring
Google Cloud Service Documentation /monitoring/docs/
Google Cloud REST Resource Name v3.projects.notificationChannels
Google Cloud REST Resource Documentation /monitoring/api/ref_v3/rest/v3/projects.notificationChannels
Config Connector Resource Short Names gcpmonitoringnotificationchannel
gcpmonitoringnotificationchannels
monitoringnotificationchannel
Config Connector Service Name monitoring.googleapis.com
Config Connector Resource Fully Qualified Name monitoringnotificationchannels.monitoring.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Annotations

Fields
cnrm.cloud.google.com/project-id
cnrm.cloud.google.com/state-into-spec

Spec

Schema

description: string
enabled: boolean
forceDelete: boolean
labels:
  string: string
resourceID: string
sensitiveLabels:
  authToken:
    value: string
    valueFrom:
      secretKeyRef:
        key: string
        name: string
  password:
    value: string
    valueFrom:
      secretKeyRef:
        key: string
        name: string
  serviceKey:
    value: string
    valueFrom:
      secretKeyRef:
        key: string
        name: string
type: string
Fields

description

Optional

string

An optional human-readable description of this notification channel. This description may provide additional details, beyond the display name, for the channel. This may not exceed 1024 Unicode characters.

enabled

Optional

boolean

Whether notifications are forwarded to the described channel. This makes it possible to disable delivery of notifications to a particular channel without removing the channel from all alerting policies that reference the channel. This is a more convenient approach when the change is temporary and you want to receive notifications from the same set of alerting policies on the channel at some point in the future.

forceDelete

Optional

boolean

If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation.

labels

Optional

map (key: string, value: string)

resourceID

Optional

string

Immutable. Optional. The service-generated name of the resource. Used for acquisition only. Leave unset to create a new resource.

sensitiveLabels

Optional

object

Different notification type behaviors are configured primarily using the the 'labels' field on this resource. This block contains the labels which contain secrets or passwords so that they can be marked sensitive and hidden from plan output. The name of the field, eg: password, will be the key in the 'labels' map in the api request. Credentials may not be specified in both locations and will cause an error. Changing from one location to a different credential configuration in the config will require an apply to update state.

sensitiveLabels.authToken

Optional

object

An authorization token for a notification channel. Channel types that support this field include: slack.

sensitiveLabels.authToken.value

Optional

string

Value of the field. Cannot be used if 'valueFrom' is specified.

sensitiveLabels.authToken.valueFrom

Optional

object

Source for the field's value. Cannot be used if 'value' is specified.

sensitiveLabels.authToken.valueFrom.secretKeyRef

Optional

object

Reference to a value with the given key in the given Secret in the resource's namespace.

sensitiveLabels.authToken.valueFrom.secretKeyRef.key

Required*

string

Key that identifies the value to be extracted.

sensitiveLabels.authToken.valueFrom.secretKeyRef.name

Required*

string

Name of the Secret to extract a value from.

sensitiveLabels.password

Optional

object

An password for a notification channel. Channel types that support this field include: webhook_basicauth.

sensitiveLabels.password.value

Optional

string

Value of the field. Cannot be used if 'valueFrom' is specified.

sensitiveLabels.password.valueFrom

Optional

object

Source for the field's value. Cannot be used if 'value' is specified.

sensitiveLabels.password.valueFrom.secretKeyRef

Optional

object

Reference to a value with the given key in the given Secret in the resource's namespace.

sensitiveLabels.password.valueFrom.secretKeyRef.key

Required*

string

Key that identifies the value to be extracted.

sensitiveLabels.password.valueFrom.secretKeyRef.name

Required*

string

Name of the Secret to extract a value from.

sensitiveLabels.serviceKey

Optional

object

An servicekey token for a notification channel. Channel types that support this field include: pagerduty.

sensitiveLabels.serviceKey.value

Optional

string

Value of the field. Cannot be used if 'valueFrom' is specified.

sensitiveLabels.serviceKey.valueFrom

Optional

object

Source for the field's value. Cannot be used if 'value' is specified.

sensitiveLabels.serviceKey.valueFrom.secretKeyRef

Optional

object

Reference to a value with the given key in the given Secret in the resource's namespace.

sensitiveLabels.serviceKey.valueFrom.secretKeyRef.key

Required*

string

Key that identifies the value to be extracted.

sensitiveLabels.serviceKey.valueFrom.secretKeyRef.name

Required*

string

Name of the Secret to extract a value from.

type

Required

string

The type of the notification channel. This field matches the value of the NotificationChannelDescriptor.type field. See https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannelDescriptors/list to get the list of valid values such as "email", "slack", etc...

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
name: string
observedGeneration: integer
verificationStatus: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

name

string

The full REST resource name for this channel. The syntax is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] is automatically assigned by the server on creation.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

verificationStatus

string

Indicates whether this channel has been verified or not. On a ListNotificationChannels or GetNotificationChannel operation, this field is expected to be populated.If the value is UNVERIFIED, then it indicates that the channel is non-functioning (it both requires verification and lacks verification); otherwise, it is assumed that the channel works.If the channel is neither VERIFIED nor UNVERIFIED, it implies that the channel is of a type that does not require verification or that this specific channel has been exempted from verification because it was created prior to verification being required for channels of this type.This field cannot be modified using a standard UpdateNotificationChannel operation. To change the value of this field, you must call VerifyNotificationChannel.

Sample YAML(s)

Basicauth Webhook Monitoring Notification Channel

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringNotificationChannel
metadata:
  # The metadata.labels field doesn't configure the notification channel
  # Specify notification channel configuration in spec.labels
  labels:
    response-priority: all
    target-user: automation
  name: monitoringnotificationchannel-sample-basicauth-webhook
spec:
  type: webhook_basicauth
  # The spec.labels field below is for configuring the desired behaviour of the notification channel
  # It does not apply labels to the resource in the cluster
  labels:
    url: http://hooks.example.com/notifications
    username: admin
  description: Sends notifications to indicated webhook URL using HTTP-standard basic authentication. Should be used in conjunction with SSL/TLS to reduce the risk of attackers snooping the credentials.
  sensitiveLabels:
    password:
      valueFrom:
        secretKeyRef:
          key: password
          name: monitoringnotificationchannel-dep-basicauthwebhook
---
apiVersion: v1
kind: Secret
metadata:
  name: monitoringnotificationchannel-dep-basicauthwebhook
data:
  password: cGFzc3dvcmQK

Disabled Email Monitoring Notification Channel

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringNotificationChannel
metadata:
  # The metadata.labels field doesn't configure the notification channel
  # Specify notification channel configuration in spec.labels
  labels:
    response-priority: longterm
    target-user: dev
  name: monitoringnotificationchannel-sample-disabled-email
spec:
  type: email
  # The spec.labels field below is for configuring the desired behaviour of the notification channel
  # It does not apply labels to the resource in the cluster
  labels:
    email_address: dev@example.com
  description: A disabled channel that would send notifications via email if enabled.
  enabled: false

Pubsub Monitoring Notification Channel

# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringNotificationChannel
metadata:
  # The metadata.labels field doesn't configure the notification channel
  # Specify notification channel configuration in spec.labels
  labels:
    response-priority: all
    target-user: automation
  name: monitoringnotificationchannel-sample-pubsub
spec:
  type: pubsub
  # The spec.labels field below is for configuring the desired behaviour of the notification channel
  # It does not apply labels to the resource in the cluster
  labels:
    # Replace ${PROJECT_ID?} with the Pub/Sub topic's project ID.
    topic: projects/${PROJECT_ID?}/topics/monitoringnotificationchannel-dep-pubsub
  description: A channel that sends notifications to a Pub/Sub topic.
  enabled: true
---
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
  name: monitoringnotificationchannel-dep-pubsub
spec:
  # Replace ${PROJECT_NUMBER?} with your project number.
  member: serviceAccount:service-${PROJECT_NUMBER?}@gcp-sa-monitoring-notification.iam.gserviceaccount.com
  role: roles/pubsub.publisher
  resourceRef:
    kind: PubSubTopic
    name: monitoringnotificationchannel-dep-pubsub
---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  labels:
    label-one: "value-one"
  name: monitoringnotificationchannel-dep-pubsub

Sms Monitoring Notification Channel

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringNotificationChannel
metadata:
  # The metadata.labels field doesn't configure the notification channel
  # Specify notification channel configuration in spec.labels
  labels:
    response-priority: intervention
    target-user: on-call
  name: monitoringnotificationchannel-sample-sms
spec:
  type: sms
  # The spec.labels field below is for configuring the desired behaviour of the notification channel
  # It does not apply labels to the resource in the cluster
  labels:
    number: "12025550196"
  description: A channel that sends notifications via Short Message Service (SMS).
  enabled: true