A Terraform module to manage notification channels on Google Cloud Platform (GCP).
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.
This module supports Terraform version 1 and is compatible with the Terraform Google Cloud Provider version 4. and 5._**
This module is part of our Infrastructure as Code (IaC) framework that enables our users and customers to easily deploy and manage reusable, secure, and production-grade cloud infrastructure.
- Module Features
- Getting Started
- Module Argument Reference
- Module Attributes Reference
- Module Outputs
- External Documentation
- Module Versioning
- About Mineiros
- Reporting Issues
- Contributing
- Makefile Targets
- License
This module implements the following Terraform resources
google_monitoring_notification_channel
Create a slack notification channel:
module "terraform-google-monitoring-notification-channel" {
source = "mineiros-io/monitoring-notification-channel/google"
version = "0.0.3"
type = "slack"
display_name = "slack-alert"
description = "An example Slack notification channel."
labels = {
channel_name = "#alerts"
}
sensitive_labels = {
auth_token = "XXX"
}See variables.tf and examples/ for details and use-cases.
-
type: (Requiredstring)The type of the notification channel. Valid values are
email,slack,sms,webhook_basicauthandpagerduty. -
project: (Optionalstring)The ID of the project in which the resource belongs. If it is not set, the provider project is used.
Default is
null. -
display_name: (Optionalstring)An human-readable name for this notification channel. It is recommended that you specify a non-empty and unique name in order to make it easier to identify the channels in your project, though this is not enforced. The display name is limited to 512 Unicode characters.
Default is
null. -
description: (Optionalstring)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.
Default is
"Notification managed by the mineiros-io/terraform-google-monitoring-notification-channel Terraform module.". -
enabled: (Optionalbool)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.
Default is
true. -
labels: (Optionalmap(string))Configuration fields that define the channel and its behavior. Labels with sensitive data should be configured via the 'sensitive_labels' block.
Default is
{}.Example:
labels = { email_address = "[email protected]" }
-
user_labels: (Optionalmap(string))User-supplied key/value data that does not need to conform to the corresponding notification channel schema, unlike the
labelsfield. The field can contain up to 64 entries. Each key and value is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values can contain only lowercase letters, numerals, underscores, and dashes. Keys must begin with a letter.Default is
{}. -
sensitive_labels: (Optionalany)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.
Default is
null.Example:
sensitive_labels = { auth_token = "example-token" }
The object accepts the following attributes:
-
auth_token: (Optionalstring)An authorization token for a notification channel. Channel types that support this field include:
slackNote: This property is sensitive and will not be displayed in the plan. -
password: (Optionalstring)An password for a notification channel. Channel types that support this field include:
webhook_basicauthNote: This property is sensitive and will not be displayed in the plan. -
service_key: (Optionalstring)An servicekey token for a notification channel. Channel types that support this field include:
pagerdutyNote: This property is sensitive and will not be displayed in the plan.
-
-
module_enabled: (Optionalbool)Specifies whether resources in the module will be created.
Default is
true. -
module_timeouts: (Optionalany)How long certain operations (per resource type) are allowed to take before being considered to have failed.
Default is
{}.Example:
module_timeouts = { google_monitoring_notification_channel = { create = "4m" update = "4m" delete = "4m" } }
The object accepts the following attributes:
-
google_monitoring_notification_channel: (Optionalany)Timeout for the
google_monitoring_notification_channelresource.The object accepts the following attributes:
-
-
module_depends_on: (Optionalany)A list of dependencies. Any object can be assigned to this list to define a hidden external dependency.
Example:
module_depends_on = [ google_monitoring_alert_policy.alert-policy ]
The following attributes are exported in the outputs of the module:
-
module_enabledWhether this module is enabled.
The following attributes are exported in the outputs of the module:
-
module_enabled: (bool)Whether this module is enabled.
-
notification_channel: (object(notification_channel))All attributes of the created
google_monitoring_notification_channelresource.
This Module follows the principles of Semantic Versioning (SemVer).
Given a version number MAJOR.MINOR.PATCH, we increment the:
MAJORversion when we make incompatible changes,MINORversion when we add functionality in a backwards compatible manner, andPATCHversion when we make backwards compatible bug fixes.
- Backwards compatibility in versions
0.0.zis not guaranteed whenzis increased. (Initial development) - Backwards compatibility in versions
0.y.zis not guaranteed whenyis increased. (Pre-release)
Mineiros is a remote-first company headquartered in Berlin, Germany that solves development, automation and security challenges in cloud infrastructure.
Our vision is to massively reduce time and overhead for teams to manage and deploy production-grade and secure cloud infrastructure.
We offer commercial support for all of our modules and encourage you to reach out if you have any questions or need help. Feel free to email us at [email protected] or join our Community Slack channel.
We use GitHub Issues to track community reported issues and missing features.
Contributions are always encouraged and welcome! For the process of accepting changes, we use Pull Requests. If you'd like more information, please see our Contribution Guidelines.
This repository comes with a handy Makefile.
Run make help to see details on each available target.
This module is licensed under the Apache License Version 2.0, January 2004. Please see LICENSE for full details.
Copyright © 2020-2022 Mineiros GmbH