Loading...
Loading...
Generates Terraform HCL configurations for Cloud Monitoring notification channels (`google_monitoring_notification_channel`) and adds notification channels to alerting policies (`google_monitoring_alert_policy`) in Google Cloud projects. Use when creating or configuring email, SMS, Slack, PagerDuty, Pub/Sub, or webhook notification channels, verifying Pub/Sub topic compatibility (including cross-project topics, message storage policies, and in-transit enforcement) and publishing permissions for the Cloud Monitoring Service Agent, or adding notification channels to existing alert policies. Don't use for authoring or editing alerting policy conditions, selecting metric descriptors, or writing PromQL or Monitoring Filter queries.
npx skill4agent add google/skills cloud-monitoring-notification-channels-configuration.tfnotification_channels.tf.tf.tf.tfgoogle_monitoring_notification_channelgoogle_monitoring_alert_policymonitoring/ops/sre/notification_channels.tf.tf.tfmonitoring/notification_channels.tfgcloudterraform{project_id}gcloud config get-value project{project_id}{project_number}gcloud projects describe {project_id} --format='value(projectNumber)'gcloudgcloud auth logingcloud auth application-default logingcloud config set project {project_id}gcloud config set project {project_id}gcloud projects describe {project_id}gcloud auth listgcloud projects listgcloud billing projects link {project_id} --billing-account={account_id}roles/monitoring.notificationChannelEditorroles/monitoring.alertPolicyEditormonitoring.notificationChannels.getmonitoring.notificationChannels.listmonitoring.notificationChannels.createmonitoring.notificationChannels.updatemonitoring.notificationChannels.deletemonitoring.alertPolicies.getmonitoring.alertPolicies.updategcloudterraformPERMISSION_DENIEDmonitoring.notificationChannels.*monitoring.alertPolicies.*roles/monitoring.notificationChannelEditorgcloud beta monitoring channels list --project={project_id}gcloudscripts/verify_pubsub_topic.sh{monitoring_project_id} {topic_name_or_path}pubsub.googleapis.comprojects/{topic_project_id}/topics/{topic_name}service-{monitoring_project_number}@gcp-sa-monitoring-notification.iam.gserviceaccount.comroles/pubsub.publishermessageStoragePolicymessage_storage_policyenforceInTransitenforce_in_transituser_labelsgoogle_monitoring_notification_channelcreated-with-google-skilluser_labelsuser_labels = {
created-with-google-skill = "cloud-monitoring-notification-channels-configuration"
}google_monitoring_alert_policycreated-with-google-skilladded-channel-with-google-skilluser_labelsuser_labelsuser_labels = {
added-channel-with-google-skill = "cloud-monitoring-notification-channels-configuration"
}gcloudCLOUDSDK_METRICS_ENVIRONMENT="google-skills google-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" \
gcloud <command> [flags]curl-H "User-Agent: ..."curl -H "User-Agent: google-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" ...planapplyGOOGLE_TERRAFORM_USERAGENT_EXTENSION="google-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" \
terraform plan [flags]gcloudscripts/verify_pubsub_topic.shCLOUDSDK_METRICS_ENVIRONMENT="google-skills google-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration; script:verify_pubsub_topic)" \
gcloud <command> [flags]terraform planterraform applyterraform planterraform apply-target-target=google_monitoring_notification_channel.<resource_name>-target=google_monitoring_alert_policy.<policy_name>secret.tfvarsassets/secret.tfvars| Notification Channel Type | Reference File |
|---|---|
| email.md | |
| sms | sms.md |
| slack | slack.md |
| pubsub | pubsub.md |
| pagerduty | pagerduty.md |
| webhook | webhook.md |
PrerequisitesRequired CredentialsSpecificationsecret.tfvarsTerraform HCLSpecificationdisplay_namedisplay_name"<Type> Notification Channel (...)"google_monitoring_alert_policygoogle_monitoring_notification_channelnotification_channelsgoogle_monitoring_alert_policyadded-channel-with-google-skill"cloud-monitoring-notification-channels-configuration"user_labelsuser_labelsnotification_channels = [
google_monitoring_notification_channel.<channel_resource_name>.name,
]
user_labels = {
added-channel-with-google-skill = "cloud-monitoring-notification-channels-configuration"
}notification_channels.tf.tfgoogle_monitoring_alert_policygoogle_monitoring_notification_channelcreated-with-google-skill"cloud-monitoring-notification-channels-configuration"user_labelsgoogle_monitoring_alert_policyadded-channel-with-google-skill"cloud-monitoring-notification-channels-configuration"user_labels