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

Inconsistent ordering of members within opsgenie_teams #418

Open
fishfacemcgee opened this issue Dec 18, 2023 · 2 comments
Open

Inconsistent ordering of members within opsgenie_teams #418

fishfacemcgee opened this issue Dec 18, 2023 · 2 comments

Comments

@fishfacemcgee
Copy link

fishfacemcgee commented Dec 18, 2023

Terraform Version

Terraform v1.6.4
on darwin_amd64
+ provider registry.terraform.io/datadog/datadog v3.32.0
+ provider registry.terraform.io/hashicorp/archive v2.4.0
+ provider registry.terraform.io/hashicorp/aws v5.25.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hashicorp/tfe v0.50.0
+ provider registry.terraform.io/integrations/github v5.42.0
+ provider registry.terraform.io/opsgenie/opsgenie v0.6.34
+ provider registry.terraform.io/sumologic/sumologic v2.27.0

Affected Resource(s)

  • opsgenie_team

Terraform Configuration Files

resource "opsgenie_user" "first" {
  username  = "[email protected]"
  full_name = "name "
  role      = "User"
}

resource "opsgenie_team" "test" {
  name        = "example"
  description = "This team deals with all the things"

  member {
    id   = "${opsgenie_user.first.id}"
  }

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Once the change has applied, no other changes will be detected as necessary without either the TF code changing or the config in OpsGenie changing.

Actual Behavior

Random drift:

- member {
    - id = "This is the user's ID" -> null
    - role = "user" -> null
    - username = "[email protected]" -> null
}
+ member {
    + id = "This ID is 100% identical to the one being deleted"
    + role = "user"
    + username = Known after apply
}

Steps to Reproduce

  1. terraform apply to apply the original config
  2. terraform plan to see random/unexpected drift

Important Factoids

This appears to be a full regression of #326 and/or #288.

References

@gustavlasko
Copy link

We are also experiencing this issue in provider version v0.6.34.

@fishfacemcgee
Copy link
Author

So, what I found as a workaround is if you also set the username attribute in the member block, that avoids the drift. Something with the username attribute being computed appears to be causing it to stay in a dirty state, even if neither the input nor output change between apply executions.

gustavlasko added a commit to gustavlasko/terraform-provider-opsgenie that referenced this issue Aug 27, 2024
When adding members to a team, if you don't specify the username in the
`member` block, the member is deleted and recreated with every plan. A
workaround for this is to set the `username` for the member as well.

opsgenie#418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants