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

Cannot plan sentry_team_member when it references an organisation member that is to be created #380

Open
deiga opened this issue Feb 1, 2024 · 0 comments

Comments

@deiga
Copy link

deiga commented Feb 1, 2024

terraform plan output:

Terraform planned the following actions, but then encountered a problem:

  # sentry_organization_member.office["foo"] will be created
  + resource "sentry_organization_member" "office" {
      + email        = "[email protected]"
      + expired      = (known after apply)
      + id           = (known after apply)
      + internal_id  = (known after apply)
      + organization = "office"
      + pending      = (known after apply)
      + role         = "member"
    }


Plan: 3 to add, 0 to change, 2 to destroy.
╷
│ Error: Client Error
│ 
│   with sentry_team_member.office["foo-bar"],
│   on teams.tf line 26, in resource "sentry_team_member" "office":
│   26: resource "sentry_team_member" "office" {
│ 
│ unable to read organization member, got error: GET
│ https://sentry.io/api/0/organizations/office/members/122345/: 404 The
│ requested resource does not exist

Resource definitions:

resource "sentry_organization_member" "office" {
  for_each     = { for k, user in local.user_objects : k => user }
  organization = data.sentry_organization.office.id
  email        = lower(each.value.email)
  role         = each.value.permissions.sentry
}


resource "sentry_team_member" "office" {
  for_each     = merge(local.users_in_teams, local.users_with_team_association)
  organization = data.sentry_organization.office.id
  member_id    = sentry_organization_member.office[each.value.shorthand].internal_id
  team         = sentry_team.office[replace(lower(each.value.team), " ", "-")].id
}
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

1 participant