Skip to content

Ambiguous documentation: Grafana alert rule groups are imported by ruleGroup not title #2473

@chrrlesWork

Description

@chrrlesWork

Terraform Version

via Pulumi

Terraform Grafana Provider Version

v3.3.0

Grafana Version

11.6.5

Affected Resource(s)

  • grafana_rule_group

Terraform Configuration Files

No response

Expected Behavior

I am using the pulumiverse_grafana 0.60 Python module that uses v3.3.0 of the TF Grafana provider.

The documentation for importing alert rule groups is misleading, as the name of the rule group (the ruleGroup field as returned by the Grafana API) is required for importing not the title (as returned by the Grafana API).

from $GRAFANA_URL/api/v1/provisioning/alert-rules:

  {
    "id": XX,
    "uid": "XXXXXXX",
    "orgID": X,
    "folderUID": "FOLDERUID",
    "ruleGroup": "Alert Group",
    "title": "Alert Group Item",
    "condition": "C",
    "data":  [
...


Actual Behavior

Performing an import using:

pulumi import -y grafana:alerting/ruleGroup:RuleGroup rule_group_alert_group_item "FOLDERUID:Alert Group Item"

will fail with:

error: Preview failed: resource 'FOLDERUID:Alert Group Item' does not exist

Steps to Reproduce

Create an alert group with multiple alert items and ensure their titles are different from the parent rule group. Then export the rulegroup via API and attempt to import using the title field.

Important Factoids

No response

References

https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/rule_group
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions