⚠️ 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.
# 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 an existing sg_chat_channel_rule using its rule UUID:
terraform import sg_chat_channel_rule.example '123e4567-e89b-12d3-a456-426614174000'
chat_provider (String) Chat provider for this rule. Must be slack or teams. Changing forces replacement.patterns (List of String) Channel-name glob patterns to match (e.g. inc-, sre-).attach_channel_context (Boolean) Attach platform channel metadata to agent context (Slack topic description and pinned messages when available). Defaults to false; safe for Teams.enabled (Boolean) Whether this rule is active for auto-enrollment. Defaults to true when omitted.tags (List of String) Operator tags applied to channels enrolled by this rule. Empty list clears tags.thread_follow (String) Thread-follow mode applied to enrolled channels. Must be off or while_waiting.created_at (String) Creation timestamp (RFC 3339).id (String) Server-assigned chat channel rule UUID. Import with: terraform import sg_chat_channel_rule.example ‘updated_at (String) Last modification timestamp (RFC 3339).