streamtime_alert_channel (Resource)

A place alerts are sent to: Slack, PagerDuty or a webhook.

Example Usage

resource "streamtime_alert_channel" "ops" {
  identifier = "ops"
  type       = "slack"

  receiver_config = jsonencode({
    api_url = var.slack_webhook_url
    channel = "#operations"
  })
}

variable "slack_webhook_url" {
  type      = string
  sensitive = true
}

Schema

Required

  • identifier (String) A short name for the channel, up to 24 lowercase letters, numbers and dashes. Changing it creates a new channel.
  • receiver_config (String, Sensitive) How to reach the destination, set with jsonencode({…}). Slack needs channel and api_url; webhooks need url; PagerDuty needs routing_key. The receiver_type is filled in from type when you leave it out.
  • type (String) Where alerts go: slack, pagerduty or webhook.

Read-Only

  • id (String) ID of the alert channel. Use it to import an existing one.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Import by the channel's identifier.
terraform import streamtime_alert_channel.ops ops