Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
156 changes: 156 additions & 0 deletions docs/resources/apps_alertenrichment_alertenrichment_v1beta1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
# 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$"
}
]

assign_step {
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))
- `assign_step` (Block List) Assign enricher step that adds or modifies annotations on alerts. (see [below for nested schema](#nestedblock--spec--assign_step))
- `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.

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

Optional:

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


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

Required:

- `annotations` (Map of String) Map of annotation names to values to set on matching alerts. Values can use Go template syntax with access to $labels and $annotations.

Optional:

- `timeout` (String) Maximum execution time (e.g., '30s', '1m'). Defaults to 30s.


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

Optional:

- `name` (String)
- `type` (String)
- `value` (String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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$"
}
]

assign_step {
annotations = {
enrichment_team = "alerting-team"
runbook_url = "https://runbooks.grafana.com/critical-alerts"
contact_slack = "#alerts-critical"
incident_severity = "high"
}
timeout = "30s"
}
}
}
75 changes: 37 additions & 38 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/terraform-provider-grafana/v4

go 1.24.2
go 1.24.6

require (
connectrpc.com/connect v1.18.1
Expand All @@ -11,12 +11,14 @@ require (
github.com/grafana/amixr-api-go-client v0.0.25
github.com/grafana/authlib/claims v0.0.0-20250120084028-e3328c576437
github.com/grafana/fleet-management-api v1.0.0
github.com/grafana/grafana-app-sdk v0.35.2-0.20250408075831-c2a87bde0849
github.com/grafana/grafana-app-sdk v0.40.3
github.com/grafana/grafana-asserts-public-clients/go/gcom v0.0.0-20250805165836-14e16b51b910
github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20250526074454-7ec66e02e4bb
github.com/grafana/grafana-openapi-client-go v0.0.0-20250617151817-c0f8cbb88d5c
github.com/grafana/grafana/apps/alerting/alertenrichment v0.0.0-20250904171753-3d6d6326866f
github.com/grafana/grafana/apps/dashboard v0.0.0-20250424064802-2fbb2d6f5d27
github.com/grafana/grafana/apps/playlist v0.0.0-20250424064802-2fbb2d6f5d27
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250424064802-2fbb2d6f5d27
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28
github.com/grafana/k6-cloud-openapi-client-go v0.0.0-20250715154343-32edc34ec1db
github.com/grafana/machine-learning-go-client v0.8.2
github.com/grafana/river v0.3.0
Expand Down Expand Up @@ -46,23 +48,20 @@ require (
github.com/urfave/cli/v2 v2.27.7
github.com/zclconf/go-cty v1.16.4
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792
golang.org/x/text v0.27.0
golang.org/x/text v0.28.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/apimachinery v0.32.3
k8s.io/client-go v0.32.3
k8s.io/apimachinery v0.33.3
k8s.io/client-go v0.33.3
)

require github.com/grafana/grafana-asserts-public-clients/go/gcom v0.0.0-20250805165836-14e16b51b910

require (
cuelang.org/go v0.11.1 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/ProtonMail/go-crypto v1.1.6 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apache/arrow-go/v18 v18.2.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
Expand All @@ -71,18 +70,18 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/chromedp/cdproto v0.0.0-20240810084448-b931b754e476 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/elazarl/goproxy v1.7.2 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/getkin/kin-openapi v0.131.0 // indirect
github.com/getkin/kin-openapi v0.132.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
Expand All @@ -95,22 +94,20 @@ require (
github.com/go-openapi/validate v0.24.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/flatbuffers v25.2.10+incompatible // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grafana/grafana-app-sdk/logging v0.35.1 // indirect
github.com/grafana/grafana-app-sdk/logging v0.40.2 // indirect
github.com/grafana/grafana-plugin-sdk-go v0.275.0 // indirect
github.com/grafana/otel-profiling-go v0.5.1 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
github.com/hashicorp/cli v1.1.7 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
Expand All @@ -119,7 +116,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.3 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.4 // indirect
github.com/hashicorp/terraform-registry-address v0.2.5 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
Expand Down Expand Up @@ -154,14 +151,15 @@ require (
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/prometheus/client_golang v1.22.0 // indirect
github.com/prometheus/client_golang v1.23.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/zerolog v1.34.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect
github.com/unknwon/com v1.0.1 // indirect
github.com/unknwon/log v0.0.0-20200308114134-929b1006e34a // indirect
Expand All @@ -181,20 +179,21 @@ require (
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0 // indirect
go.opentelemetry.io/contrib/propagators/jaeger v1.35.0 // indirect
go.opentelemetry.io/contrib/samplers/jaegerremote v0.29.0 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/crypto v0.40.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/mod v0.26.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/term v0.33.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.35.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
Expand All @@ -208,15 +207,15 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/validator.v2 v2.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.32.3 // indirect
k8s.io/apiextensions-apiserver v0.32.3 // indirect
k8s.io/api v0.33.3 // indirect
k8s.io/apiextensions-apiserver v0.33.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
sigs.k8s.io/yaml v1.5.0 // indirect
)

// https://github.com/hashicorp/terraform-exec/issues/423
Expand Down
Loading
Loading