Skip to content

Latest commit

 

History

History
140 lines (106 loc) · 3.48 KB

File metadata and controls

140 lines (106 loc) · 3.48 KB
page_title flashduty_inhibit_rule Resource - flashduty
subcategory
description Manages a Flashduty inhibit rule for a channel.

flashduty_inhibit_rule (Resource)

Manages a Flashduty inhibit rule for a channel.

Example Usage

# Inhibit low-severity alerts when critical alert exists
resource "flashduty_inhibit_rule" "critical_inhibits_warning" {
  channel_id  = 6148622168454
  rule_name   = "Critical Inhibits Warning"
  description = "Suppress warning alerts when critical alert is active for same host"

  source_filters = [
    {
      conditions = [
        {
          key  = "severity"
          oper = "IN"
          vals = ["Critical"]
        }
      ]
    }
  ]

  target_filters = [
    {
      conditions = [
        {
          key  = "severity"
          oper = "IN"
          vals = ["Warning", "Info"]
        }
      ]
    }
  ]

  equals = ["host", "service"]

  is_directly_discard = true
}

# Inhibit downstream service alerts when upstream is down
resource "flashduty_inhibit_rule" "upstream_inhibits_downstream" {
  channel_id  = 6148622168454
  rule_name   = "Upstream Inhibits Downstream"
  description = "Suppress downstream alerts when upstream service is down"

  source_filters = [
    {
      conditions = [
        {
          key  = "labels.service"
          oper = "IN"
          vals = ["database", "cache"]
        }
      ]
    }
  ]

  target_filters = [
    {
      conditions = [
        {
          key  = "labels.service"
          oper = "IN"
          vals = ["api", "web"]
        }
      ]
    }
  ]

  equals = ["datacenter"]

  is_directly_discard = true
}

Schema

Required

  • channel_id (Number) The ID of the channel this rule belongs to.
  • description (String) The description of the rule.
  • equals (List of String) Fields that must be equal between source and target (e.g., labels.host).
  • rule_name (String) The name of the inhibit rule.
  • source_filters (Attributes List) Source event filter conditions (OR groups of AND conditions). (see below for nested schema)
  • target_filters (Attributes List) Target event filter conditions (events to be inhibited). (see below for nested schema)

Optional

  • is_directly_discard (Boolean) Whether to directly discard matching alerts.
  • priority (Number) The priority of the rule.

Read-Only

  • id (String) The unique identifier of the inhibit rule.

Nested Schema for source_filters

Required:

Nested Schema for source_filters.conditions

Required:

  • key (String) The attribute or label key.
  • oper (String) The operator: IN or NOTIN.
  • vals (List of String) The values to match.

Nested Schema for target_filters

Required:

Nested Schema for target_filters.conditions

Required:

  • key (String) The attribute or label key.
  • oper (String) The operator: IN or NOTIN.
  • vals (List of String) The values to match.