azurerm_datadog_monitor_tag_rule

Manages TagRules on the datadog Monitor.

Example Usage

Adding TagRules on monitor

resource "azurerm_resource_group" "example" {
  name     = "example-datadog"
  location = "West US 2"
}

resource "azurerm_datadog_monitor" "example" {
  name                = "example-monitor"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  datadog_organization {
    api_key         = "XXXX"
    application_key = "XXXX"
  }
  user {
    name  = "Example"
    email = "abc@xyz.com"
  }
  sku_name = "Linked"
  identity {
    type = "SystemAssigned"
  }
}

resource "azurerm_datadog_monitor_tag_rule" "example" {
  datadog_monitor_id = azurerm_datadog_monitor.example.id
  log {
    subscription_log_enabled = true
  }
  metric {
    filter {
      name   = "Test"
      value  = "Logs"
      action = "Include"
    }
  }
}

Arguments Reference

The following arguments are supported:



An log block supports the following:

NOTE: List of filtering tags to be used for capturing logs. This only takes effect if resource_log_enabled flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.


A metric block supports the following:

NOTE: List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.


A filter block supports the following:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Tag Rules on the Datadog Monitor can be imported using the tag rule resource id, e.g.

```shell terraform import azurerm_datadog_monitor_tag_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Datadog/monitors/monitor1/tagRules/default