Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grafana_organization resource is not working as expected after addition of grafana admin user in admins list #36252

Open
Shindek77 opened this issue Jan 2, 2025 · 1 comment
Labels
bug new new issue not yet triaged waiting-response An issue/pull request is waiting for a response from the community

Comments

@Shindek77
Copy link

Shindek77 commented Jan 2, 2025

Terraform Version

Terraform v1.8.0
on darwin_arm64

Terraform Configuration Files

resource "grafana_organization" "organization" {
  name         = "Test Organization"
  admin_user   = "admin"
  create_users = true
  admins = [
    "admin@localhost"
  ]
}

Debug Output

na

Expected Behavior

on first terraform apply it should show

 + resource "grafana_organization" "organization" {
      + admins               = [
          + "admin@localhost",
        ]
        id                   = "7"
        name                 = "Test Organization"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

But if we do second terraform apply then it should say
`No Changes`

Actual Behavior

but on second terraform apply it shows as follows:

   # resource.organization["grafana_org_config-8"].grafana_organization.organization will be updated in place
  ~ resource "grafana_organization" "organization" {
      ~ admins               = [
          + "admin@localhost"
        ]
        id                   = "7"
        name                 = "Test Organization"
        # (2 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Why its showing one to change as its already added as admin user in tfstate also and on Grafana UI also as we verified.

Steps to Reproduce

  1. Create new Test org on Grafana with admin@localhost user added in admins list
  2. Use Grafana provider with grafana_orgnization resource and do terraform plan and apply 2 3 times

Additional Context

No response

References

No response

Generative AI / LLM assisted development?

No response

@Shindek77 Shindek77 added bug new new issue not yet triaged labels Jan 2, 2025
@liamcervante
Copy link
Member

Hi @Shindek77, have you checked in with the grafana provider directly about this issue? I think this is more likely to be something specific to the Grafana provider rather than anything within Terraform Core.

If so, can you confirm if the admin user is present in the state file after the first apply, and can you check the output of running terraform plan -refresh-only? This would help us narrow down the problem to a specific part of the Terraform lifecycle. Thanks!

@liamcervante liamcervante added the waiting-response An issue/pull request is waiting for a response from the community label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

No branches or pull requests

2 participants