Create and manage notification channels with Terraform
Stay organized with collections
Save and categorize content based on your preferences.
This document describes how to use the
Google Cloud Terraform Provider to create
notification channels in your Google Cloud project. The Google Cloud Terraform Provider
offers the following resources for alerting policies and notification channels:
Terraform is a tool for building,
changing, and versioning infrastructure. It uses configuration files to describe
the components needed to run a single application or your entire infrastructure.
For more information about using Terraform, see the following:
To get the permissions that
you need to create and modify notification channels by using Terraform,
ask your administrator to grant you the
Notification Channel Editor (roles/monitoring.notificationChannelEditor)
IAM role on your project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
In the Cloud Shell,
go to the directory that contains your Terraform configuration.
Edit your configuration file, find the
google_monitoring_notification_channel
resource for your notification channel, and then modify or delete that
resource.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Create and manage notification channels with Terraform\n\nThis document describes how to use the\nGoogle Cloud Terraform Provider to create\nnotification channels in your Google Cloud project. The Google Cloud Terraform Provider\noffers the following resources for alerting policies and notification channels:\n\n- [google_monitoring_alert_policy](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_alert_policy)\n- [google_monitoring_notification_channel](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_notification_channel)\n\n[Terraform](https://www.terraform.io/) is a tool for building,\nchanging, and versioning infrastructure. It uses configuration files to describe\nthe components needed to run a single application or your entire infrastructure.\nFor more information about using Terraform, see the following:\n\n- [Terraform on Google Cloud documentation](/docs/terraform#docs)\n- [Google Cloud Terraform Provider](https://registry.terraform.io/providers/hashicorp/google/latest/docs)\n- [Get Started - Google Cloud](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started)\n\nBefore you begin\n----------------\n\n\nTo get the permissions that\nyou need to create and modify notification channels by using Terraform,\n\nask your administrator to grant you the\n\n\n[Notification Channel Editor](/iam/docs/roles-permissions/monitoring#monitoring.notificationChannelEditor) (`roles/monitoring.notificationChannelEditor`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nFor more information about Cloud Monitoring roles,\nsee [Control access with Identity and Access Management](/monitoring/access-control).\n\nCreate a notification channel\n-----------------------------\n\nTo create a notification channel in your Google Cloud project, do the following:\n\n1. [Install and configure Terraform](/docs/terraform/install-configure-terraform).\n\n2. In the Cloud Shell,\n go to the directory that contains your Terraform configuration.\n\n3. Edit the configuration file and add your notification channel.\n\n For example, the following configuration defines an email\n notification channel: \n\n resource \"google_monitoring_notification_channel\" \"email\" {\n display_name = \"Tier 1 Support Email\"\n type = \"email\"\n labels = {\n email_address = \"\u003cvar translate=\"no\"\u003eUSER_EMAIL\u003c/var\u003e\"\n }\n }\n\n4. In the Cloud Shell, enter `terraform apply`.\n\nEdit or delete notification channels\n------------------------------------\n\nTo edit or delete a notification channel in your Google Cloud project, do the\nfollowing:\n\n1. [Install and configure Terraform](/docs/terraform/install-configure-terraform).\n\n2. In the Cloud Shell,\n go to the directory that contains your Terraform configuration.\n\n3. Edit your configuration file, find the\n `google_monitoring_notification_channel`\n resource for your notification channel, and then modify or delete that\n resource.\n\n4. In the Cloud Shell, enter `terraform apply`.\n\nWhat's next\n-----------\n\n- [Create alerting policies with Terraform](/monitoring/alerts/terraform).\n- Learn more about [Terraform](https://www.terraform.io/).\n- Try out code samples that use the Google Cloud Terraform Provider with Cloud Monitoring.\n- View the Google Cloud Terraform Provider [repository on GitHub](https://github.com/hashicorp/terraform-provider-google).\n- [File a GitHub issue](https://github.com/hashicorp/terraform-provider-google/issues) to report a bug or ask a question about Terraform."]]