Skip to content

grafana_frontend_o11y_app.allowed_origins causes perpetual diff due to ordering #2634

@eserte

Description

@eserte

Terraform Version

v1.11.4

Terraform Grafana Provider Version

v4.28.1

Grafana Version

Grafana Cloud

Affected Resource(s)

grafana_frontend_o11y_app (resource)

Terraform Configuration Files

resource "grafana_frontend_o11y_app" "example" {
  name     = "example-app"
  stack_id = 1234

  allowed_origins = [
    "https://app.example.com",
    "https://internal.example.com",
    "http://localhost:4200",
  ]
}

Expected Behavior

On a repeated terraform plan/apply after a previous terraform apply there should be no diffs.

Actual Behavior

Terraform shows a diff only due to reordering:

~ allowed_origins = [
-  "http://localhost:4200",
   "https://app.example.com",
   "https://internal.example.com",
+  "http://localhost:4200",
]

So the order returned after apply appears to be lexically sorted (e.g. "http://..." before "https://...")

Possible workaround: Sorting the list in configuration avoids the diff:

allowed_origins = sort([
  "https://app.example.com",
  "https://internal.example.com",
  "http://localhost:4200",
])

Steps to Reproduce

No response

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions