Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions docs/resources/apps_alertenrichment_alertenrichment_v1beta1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "grafana_apps_alertenrichment_alertenrichment_v1beta1 Resource - terraform-provider-grafana"
subcategory: "Alerting"
description: |-
Manages Grafana Alert Enrichments.
---

# grafana_apps_alertenrichment_alertenrichment_v1beta1 (Resource)

Manages Grafana Alert Enrichments.

## Example Usage

```terraform
resource "grafana_apps_alertenrichment_alertenrichment_v1beta1" "example" {
metadata = {
uid = "alert-enrichment-example"
}

spec {
title = "Critical Alert Enrichment Pipeline"
description = "Enriches critical production alerts with team information"

# Apply only to specific alert rules
alert_rule_uids = ["high-cpu-alert", "disk-space-alert"]

# Apply only to specific receivers
receivers = ["critical-alerts", "alerting-team"]

# Match alerts with specific labels
label_matchers = [
{
type = "="
name = "severity"
value = "critical"
},
{
type = "=~" # Regex match
name = "environment"
value = "prod.*"
},
{
type = "!="
name = "team"
value = "test"
}
]

# Match alerts with specific annotations
annotation_matchers = [
{
type = "!~" # Regex not match
name = "runbook_url"
value = "^http://grafana.com$"
}
]

step {
assign {
annotations = {
enrichment_team = "alerting-team"
runbook_url = "https://runbooks.grafana.com/critical-alerts"
contact_slack = "#alerts-critical"
incident_severity = "high"
}
timeout = "30s"
}
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `metadata` (Block, Optional) The metadata of the resource. (see [below for nested schema](#nestedblock--metadata))
- `options` (Block, Optional) Options for applying the resource. (see [below for nested schema](#nestedblock--options))
- `spec` (Block, Optional) The spec of the resource. (see [below for nested schema](#nestedblock--spec))

### Read-Only

- `id` (String) The ID of the resource derived from UUID.

<a id="nestedblock--metadata"></a>
### Nested Schema for `metadata`

Required:

- `uid` (String) The unique identifier of the resource.

Optional:

- `folder_uid` (String) The UID of the folder to save the resource in.

Read-Only:

- `url` (String) The full URL of the resource.
- `uuid` (String) The globally unique identifier of a resource, used by the API for tracking.
- `version` (String) The version of the resource.


<a id="nestedblock--options"></a>
### Nested Schema for `options`

Optional:

- `overwrite` (Boolean) Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.


<a id="nestedblock--spec"></a>
### Nested Schema for `spec`

Required:

- `title` (String) The title of the alert enrichment.

Optional:

- `alert_rule_uids` (List of String) UIDs of alert rules this enrichment applies to. If empty, applies to all alert rules.
- `annotation_matchers` (List of Object) Annotation matchers that an alert must satisfy for this enrichment to apply. Each matcher is an object with: 'type' (string, one of: =, !=, =~, !~), 'name' (string, annotation key to match), 'value' (string, annotation value to compare against, supports regex for =~/!~ operators). (see [below for nested schema](#nestedatt--spec--annotation_matchers))
- `description` (String) Description of the alert enrichment.
- `label_matchers` (List of Object) Label matchers that an alert must satisfy for this enrichment to apply. Each matcher is an object with: 'type' (string, one of: =, !=, =~, !~), 'name' (string, label key to match), 'value' (string, label value to compare against, supports regex for =~/!~ operators). (see [below for nested schema](#nestedatt--spec--label_matchers))
- `receivers` (List of String) Receiver names to match. If empty, applies to all receivers.
- `step` (Block List) Enrichment step. Can be repeated multiple times to define a sequence of steps. Each step must contain exactly one enrichment block. (see [below for nested schema](#nestedblock--spec--step))

<a id="nestedatt--spec--annotation_matchers"></a>
### Nested Schema for `spec.annotation_matchers`

Optional:

- `name` (String)
- `type` (String)
- `value` (String)


<a id="nestedatt--spec--label_matchers"></a>
### Nested Schema for `spec.label_matchers`

Optional:

- `name` (String)
- `type` (String)
- `value` (String)


<a id="nestedblock--spec--step"></a>
### Nested Schema for `spec.step`

Optional:

- `assign` (Block, Optional) Assign annotations to an alert. (see [below for nested schema](#nestedblock--spec--step--assign))

<a id="nestedblock--spec--step--assign"></a>
### Nested Schema for `spec.step.assign`

Optional:

- `annotations` (Map of String) Map of annotation names to values to set on matching alerts.
- `timeout` (String) Maximum execution time (e.g., '30s', '1m')
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
resource "grafana_apps_alertenrichment_alertenrichment_v1beta1" "example" {
metadata = {
uid = "alert-enrichment-example"
}

spec {
title = "Critical Alert Enrichment Pipeline"
description = "Enriches critical production alerts with team information"

# Apply only to specific alert rules
alert_rule_uids = ["high-cpu-alert", "disk-space-alert"]

# Apply only to specific receivers
receivers = ["critical-alerts", "alerting-team"]

# Match alerts with specific labels
label_matchers = [
{
type = "="
name = "severity"
value = "critical"
},
{
type = "=~" # Regex match
name = "environment"
value = "prod.*"
},
{
type = "!="
name = "team"
value = "test"
}
]

# Match alerts with specific annotations
annotation_matchers = [
{
type = "!~" # Regex not match
name = "runbook_url"
value = "^http://grafana.com$"
}
]

step {
assign {
annotations = {
enrichment_team = "alerting-team"
runbook_url = "https://runbooks.grafana.com/critical-alerts"
contact_slack = "#alerts-critical"
incident_severity = "high"
}
timeout = "30s"
}
}
}
}
Loading
Loading