Skip to main content
BuildOfficialCertifiedReviewed Oct 14, 2026

Cloud Monitoring Notification Channels Configuration

We earn commissions when you shop through the links below.

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.

v1.0.2New

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install google-cloud-skills-cloud-monitoring-notification-channels-configuration
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/google-cloud-skills-cloud-monitoring-notification-channels-configuration/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

Cloud Monitoring Notification Channels Configuration

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)"
and append agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration) to User-Agent headers.

Context Provided

  • Terraform Only: Write the generated observability configuration ONLY as
    Terraform (.tf) files (e.g., notification_channels.tf).

    • Install Terraform ONLY if you are asked to deploy the channels AND
      there is no valid Terraform installation.
    • If you are NOT asked to deploy the channels, DO NOT install
      Terraform.
  • Working Directory Inference: Determine the target path for .tf files
    using the following order:

    1. If the user provides a path, use that exact path for the .tf file.
    2. If a path is not provided, search the workspace for existing .tf files
      (preferring files that already define
      google_monitoring_notification_channel or
      google_monitoring_alert_policy resources, or existing directories in
      the strict preference order: monitoring/, then ops/, then sre/).
      If found, write notification_channels.tf in that directory (or update
      the existing .tf file when modifying an existing resource).
    3. If a path is not provided and no .tf files or target directories exist
      in the workspace, create and write to
      monitoring/notification_channels.tf.
  • Google Cloud Prerequisites: When running gcloud CLI discovery commands
    or deploying configurations with the terraform CLI against a Google Cloud
    project, ensure the following prerequisites are met in order (do not execute
    these commands if the user only asks to generate or print Terraform HCL):

    1. Target Project ID & Project Number:
      • Identify the target Google Cloud {project_id} from the user's
        request or via gcloud config get-value project. If neither is
        available, prompt the user to provide {project_id} before
        continuing.
      • When the Google Cloud project number ({project_number}) is needed
        (such as constructing the Cloud Monitoring Service Agent identity
        for Pub/Sub channels):
        • Method A (Standard): Run gcloud projects describe {project_id} --format='value(projectNumber)'.
        • Method B (Ask User): If the command fails or you cannot
          retrieve the project number, ask the user to provide it.
    2. Authentication: Authenticate the gcloud CLI via gcloud auth login and configure Application Default Credentials (ADC) for Terraform
      via gcloud auth application-default login.
    3. Project Configuration & Billing: Configure the target Google Cloud
      project via gcloud config set project {project_id} (and ensure the
      project has an active billing account attached).
      • Recovery Actions: If gcloud config set project {project_id} or
        gcloud projects describe {project_id} fails, verify active
        credentials with gcloud auth list, list accessible projects with
        gcloud projects list, or prompt the user to confirm the project ID
        and access permissions. If deployment fails due to a missing or
        inactive billing account, stop deployment and instruct the user to
        link an active billing account (via gcloud billing projects link {project_id} --billing-account={account_id} or in the Google Cloud
        console) before retrying.
    4. IAM Permissions: Ensure the principal has permission to manage
      notification channels—either via the predefined Monitoring
      NotificationChannel Editor role
      (roles/monitoring.notificationChannelEditor, plus
      roles/monitoring.alertPolicyEditor when adding a channel to an
      existing alert policy) or via a custom IAM role containing the
      equivalent permissions (monitoring.notificationChannels.get,
      monitoring.notificationChannels.list,
      monitoring.notificationChannels.create,
      monitoring.notificationChannels.update,
      monitoring.notificationChannels.delete, and
      monitoring.alertPolicies.get / monitoring.alertPolicies.update when
      updating an alert policy).
      • Recovery Actions: Users with a custom role granting these
        permissions do not need the predefined role name. If a gcloud or
        terraform command fails with PERMISSION_DENIED (HTTP 403), stop
        execution, identify the missing monitoring.notificationChannels.*
        or monitoring.alertPolicies.* permission, and instruct the user to
        ask a project administrator to grant
        roles/monitoring.notificationChannelEditor (or a custom role with
        the required permissions) to their principal.
  • Discovery Tips:

    • Listing Notification Channels: You MUST use gcloud beta monitoring channels list --project={project_id} to list notification channels. Do
      NOT use any other gcloud commands to list notification channels.
    • Verifying Pub/Sub Topics: When configuring a Pub/Sub notification
      channel, run
      scripts/verify_pubsub_topic.sh
      {monitoring_project_id} {topic_name_or_path} to verify that:
      1. The Pub/Sub API (pubsub.googleapis.com) is enabled in the topic's
        project (supporting both same-project topics and cross-project
        topics specified as
        projects/{topic_project_id}/topics/{topic_name}).
      2. The topic exists and the monitoring project's Cloud Monitoring
        Service Agent
        (service-{monitoring_project_number}@gcp-sa-monitoring-notification.iam.gserviceaccount.com)
        holds roles/pubsub.publisher on the topic or topic project.
      3. The topic does not define a message storage policy
        (messageStoragePolicy / message_storage_policy) and does not
        have in-transit enforcement (enforceInTransit /
        enforce_in_transit) enabled. DO NOT use a Pub/Sub topic that
        defines a message storage policy or enforces in-transit restrictions
        as a notification channel, because Cloud Monitoring cannot deliver
        messages to such topics.
  • Attribution: You MUST tag EVERY applicable command and Terraform
    resource below that you create, modify, or suggest to the user.

    • Terraform HCL (user_labels):

      • Every google_monitoring_notification_channel resource that you
        create MUST include the created-with-google-skill label in its
        user_labels block:

        user_labels = {
          created-with-google-skill = "cloud-monitoring-notification-channels-configuration"
        }
        
      • When modifying an existing google_monitoring_alert_policy resource
        solely to add a notification channel, do not use
        created-with-google-skill (since this skill did not create the
        alerting policy). Instead, include the
        added-channel-with-google-skill label in its user_labels block
        (preserving any existing user_labels on the policy):

        user_labels = {
          added-channel-with-google-skill = "cloud-monitoring-notification-channels-configuration"
        }
        
    • Follow the instructions below based on the CLI tool being used:

      • gcloud: Prefix every gcloud invocation with the metrics
        environment variables. Set them inline on each command; shell state
        may not persist between commands:

        CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" \
            gcloud <command> [flags]
        
      • Direct HTTP calls: For direct HTTP calls (e.g. curl), you MUST
        pass the explicit -H "User-Agent: ..." header in the shell command
        syntax exactly like this:

        curl -H "User-Agent: agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" ...
        
      • Terraform: Prefix every Terraform plan and apply invocation
        with the metrics environment variables. Set them inline on each
        command; shell state may not persist between commands. For example:

        GOOGLE_TERRAFORM_USERAGENT_EXTENSION="agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration)" \
            terraform plan [flags]
        
    • If the skill instructions provide an additional skill script name,
      include that script name in the attribution label. Using a gcloud
      command inside
      scripts/verify_pubsub_topic.sh as an
      example:

      CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-monitoring-notification-channels-configuration; script:verify_pubsub_topic)" \
          gcloud <command> [flags]
      
  • Execution Note (State Refresh Timeout Recovery): When running terraform plan or terraform apply, set a command timeout of 120 seconds. If the
    command does not complete within 120 seconds (indicating Terraform is
    stalling on a full state refresh across a large state file rather than
    normal execution), cancel the command and retry at most once by running
    terraform plan and terraform apply with -target scoped to the specific
    resources being created or updated (for example,
    -target=google_monitoring_notification_channel.<resource_name> and, if
    updating an alert policy,
    -target=google_monitoring_alert_policy.<policy_name>). If the targeted
    retry also times out after 120 seconds or fails, DO NOT retry again;
    stop execution and report the timeout or error to the user.

Generation

Input Assumptions (checklist)

  • Notification Channel Type: When creating a new notification channel, the
    user MUST provide the notification channel type to configure.
    • If no type is provided (and the user is not attaching an existing
      notification channel to an alert policy), you MUST prompt the user to
      ask for a type before continuing.
  • Sensitive Credentials File: Some notification channels require the use
    of sensitive credentials in their configuration. You MUST verify that the
    user has a secret.tfvars file in the working directory. If the file does
    not exist, create one using the template provided in
    assets/secret.tfvars and notify the user that
    credentials should be stored there.

Execution Steps

  1. Open the reference file corresponding to the notification channel the user
    wants to configure:

    Notification Channel TypeReference File
    emailemail.md
    smssms.md
    slackslack.md
    pubsubpubsub.md
    pagerdutypagerduty.md
    webhookwebhook.md
  2. Follow the guidelines in the Prerequisites section (if any) to complete
    all requirements for the channel configuration.

  3. If the reference file contains a Required Credentials section under
    Specification, you MUST confirm that the listed required credentials are
    configured in the secret.tfvars file.

    • If any of the credentials are set to empty or not found in the file, you
      MUST prompt the user to provide them before proceeding.
  4. Use the template provided in the Terraform HCL section under
    Specification inside the reference file replacing the specified variables
    as needed to write the new configuration into the output file. If the user
    explicitly specifies a display_name for the notification channel, set
    display_name to that exact string instead of the default
    "<Type> Notification Channel (...)" template string.

  5. Adding a Channel to an Existing Alert Policy: When modifying an existing
    google_monitoring_alert_policy resource to use an existing
    google_monitoring_notification_channel resource (without creating a new
    channel), set notification_channels on the
    google_monitoring_alert_policy block and set the
    added-channel-with-google-skill label to
    "cloud-monitoring-notification-channels-configuration" in its
    user_labels block (preserving any existing user_labels):

    notification_channels = [
      google_monitoring_notification_channel.<channel_resource_name>.name,
    ]
    user_labels = {
      added-channel-with-google-skill = "cloud-monitoring-notification-channels-configuration"
    }
    

Outputs & Formats

Write all channel configurations into a notification_channels.tf file under
the directory chosen in the #context-provided section (or update the target
.tf file when adding notification channels to an existing
google_monitoring_alert_policy). Ensure every generated
google_monitoring_notification_channel resource sets
created-with-google-skill to
"cloud-monitoring-notification-channels-configuration" in user_labels, and
every modified google_monitoring_alert_policy resource sets
added-channel-with-google-skill to
"cloud-monitoring-notification-channels-configuration" in user_labels.


Supporting Links

  • Create and manage notification channels
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
google-cloud-storage-bucket-architectCreates Cloud Storage on Google Cloud (also known colloquially as GCS) buckets. Analyzes the workload (sensitive data, media hosting, ingestion, web hosting, archiving, backup, logging, analytics, AI/ML, or general-purpose), validates project-level security settings, and designs a secure-by-default, cost-effective configuration (location, storage class, uniform bucket-level access, public access prevention, soft delete, lifecycle) before creating it. Use whenever a user wants to create, make, set up, provision, or spin up a bucket, or needs object storage for an app, service, pipeline, or dataset — even a "simple" or "default" bucket, or when bucket creation is one step in a larger workflow. Outputs or executes the creation via gcloud, the JSON/REST API, Terraform, or SDK client libraries (C++, Java, Python, Go). Don't use for anything other than creating new buckets — for uploads, downloads, access changes, or reconfiguring existing buckets, use google-cloud-storage-basics.1 installsgke-cost-analysisAnswer natural language questions and perform analysis on GKE cluster and workload costs using BigQuery billing exports, cost allocation data, and live cluster monitoring metrics. Use when querying GKE costs across projects, namespaces, or workloads, analyzing billing reports in BigQuery (`bq`), checking cluster cost budgets (`gcloud billing`), or diagnosing cost drivers like pod requests vs. actual utilization (`kubectl top`). Don't use for applying cost optimization changes, creating rightsizing manifests (VPA/MPA), or selecting ComputeClasses (use gke-cost-optimization instead).1 installsmanaged-airflow-migrationsProvides guidance for migrating Apache Airflow DAGs in Managed Service for Apache Airflow (MSAA; formerly Cloud Composer). Covers migration to Airflow 2.11.1 (MSAA Gen 2 and 3) and Airflow 3 (MSAA Gen 3), including environment inspection, GCS download/upload and scanning patterns for breaking changes. Use when migrating the DAG code to newer Airflow version. Don't use when checking DAG run failures unrelated to code migration.1 installsfirebase-basicsProvides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project creation, project selection (`firebase use`), and app config file downloads (`google-services.json`, `GoogleService-Info.plist`). Use ONLY for CLI login, project creation/switching, or downloading app config files. Don't use for Firebase Hosting deploy, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config.1 installsgoogle-cloud-solution-rag-enterprise-search-gke-sqldbDiscovers requirements, and generates architectural, design, and deployment guidance for a retrieval-augmented generation (RAG)-capable enterprise search system in Google Cloud. Use when users need a vector-enabled SQL database as the store and index for the embedding vectors, an open model and open-source inferencing framework, and Kubernetes containers to host all the application components. DON'T use this skill for fully-managed RAG, or SaaS search services, or when a non-SQL vector database is required.1 installsbigtable-basicsAssists in provisioning instances/tables, designing performant schemas, and querying data in Bigtable. Use when designing Bigtable row keys, configuring column families, writing SQL queries or client library code (Java, Go, Python) for Bigtable, or diagnosing performance/hotspotting issues. Also use when provisioning Bigtable clusters using gcloud or cbt CLIs. Don't use for generic Cloud SQL administration.1 installs

More from Google Cloud Skills

View source →
spanner-basicsAssists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.4 installsgoogle-ads-api-mcp-setupGuides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server. Use this skill when a user wants to connect their AI assistant (such as Gemini, Claude Code, or Cursor) to their Google Ads account to query campaigns or retrieve reporting metrics using natural language.4 installsgke-workload-securityAudits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).3 installsgke-upgradesPlans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GK2 installsgoogle-cloud-recipe-networking-observabilityInvestigates Google Cloud networking issues by analyzing logs, metrics, and diagnostics. Use when investigating VPC Flow Logs, NAT, firewall, or threat logs, querying latency and throughput metrics, or running Connectivity Tests for path diagnostics.2 installsgke-manifest-generationGenerates and updates secure, production-ready Kubernetes YAML manifests optimized for GKE Autopilot and GKE Standard clusters. Use when creating or modifying GKE deployment manifests, configuring container security contexts, setting CPU/memory resource limits, defining readiness/liveness/startup probes, mounting secrets and volumes, configuring GKE Gateway API routes, targeting Spot VMs, or deploying AI model inference workloads (vLLM, TGI, Gemma). Don't use for live cluster operations, pod troubleshooting (use gke-workload-troubleshooting), or cluster infrastructure provisioning (use gke-cluster-creation).2 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.647 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.549 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.358 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.258 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.183 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions147 installs

Frequently asked questions about cloud-monitoring-notification-channels-configuration

What does the cloud-monitoring-notification-channels-configuration skill do?

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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the cloud-monitoring-notification-channels-configuration skill?

Run `npx @skills-hub-ai/cli install google-cloud-skills-cloud-monitoring-notification-channels-configuration` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/google-cloud-skills-cloud-monitoring-notification-channels-configuration/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does cloud-monitoring-notification-channels-configuration work with?

cloud-monitoring-notification-channels-configuration runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the cloud-monitoring-notification-channels-configuration skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use cloud-monitoring-notification-channels-configuration after installing it?

In Claude Code, type `/google-cloud-skills-cloud-monitoring-notification-channels-configuration` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the cloud-monitoring-notification-channels-configuration skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.