terraform-provider-stackgen

sg_chat_channel_rule (Resource)

⚠️ Experimental — Manages a Guild chat channel auto-enroll rule. When the bot is invited to a channel whose name matches one of the rule’s glob patterns, the channel is registered and enabled with this rule’s tags and thread-follow mode.

Example Usage

# When to use: Auto-register Slack/Teams channels when the bot is invited and
# the channel name matches a glob (e.g. inc-*, sre-*). Prefer this over creating
# every sg_chat_channel by hand for large orgs.
#
# Related: sg_chat_channel (manual allowlist), sg_chat_subscription (route events
# using the tags this rule applies).
resource "sg_chat_channel_rule" "incident_channels" {
  chat_provider = "slack"
  patterns      = ["inc-*", "sre-*", "sev*"]
  enabled       = true
  tags          = ["incidents", "auto-enrolled"]
  thread_follow = "while_waiting"
}

Import

Import an existing sg_chat_channel_rule using its rule UUID:

terraform import sg_chat_channel_rule.example '123e4567-e89b-12d3-a456-426614174000'

Schema

Required

Optional

Read-Only