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

produced an unexpected new value: .role: was null, but now cty.StringVal("admin"). #370

Closed
axelfulop opened this issue Jan 9, 2024 · 4 comments

Comments

@axelfulop
Copy link

axelfulop commented Jan 9, 2024

Hello, we noticed that the provider was updated, so when we tried to also update the resources we are having the following error:

When applying changes to sentry_team_member.admins["asaf@livekindred.com"], provider "provider["registry.terraform.io/jianyuan/sentry"]" produced an unexpected new value: .role: was null, but now cty.StringVal("admin").

image


Terraform cfg:

terraform {
  backend "remote" {
    organization = "kindred"

    workspaces {
      name = "aws-root"
    }
  }

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.35.0"
    }
    datadog = {
      source = "DataDog/datadog"
    }

    sentry = {
      source = "jianyuan/sentry"
    }
  }
  required_version = ">= 1.2.0"
}

provider "aws" {
  region = var.region
  default_tags {
    tags = local.tags
  }
}


provider "datadog" {
  api_key = var.dd_api_key
  app_key = var.dd_app_key
}

provider "sentry" {
  token    = var.sentry_auth_token
}


Sentry.tf
resource "sentry_organization_member" "admins" {
  for_each = { for user in local.admin_group : user.email => user }

  organization = "kindred-concepts-com"
  email        = each.value.email
  role         = lookup(each.value.sentry, "role", "member")
}


resource "sentry_organization_member" "devs" {
  for_each = { for user in local.developer_group : user.email => user }

  organization = "kindred-concepts-com"
  email        = each.value.email
  role         = lookup(each.value.sentry, "role", "member")
}
resource "sentry_team_member" "admins" {
  for_each = { for key, member in sentry_organization_member.admins : key => member }

  organization = "kindred-concepts-com"
  team         = "eng"
  member_id    = each.value.internal_id

  depends_on = [sentry_organization_member.admins]
}

resource "sentry_team_member" "devs" {
  for_each = { for key, member in sentry_organization_member.devs : key => member }

  organization = "kindred-concepts-com"
  team         = "eng"
  member_id    = each.value.internal_id

  depends_on = [sentry_organization_member.devs]
}

Then i tried to figure out what was going on so commented the sentry cfg and files and having this error:

Error: Client Error

unable to find team member

If i comment the sentry part, still having same issue
{“@Level”:“error”,“@message”:“Error: Client Error”,“@module”:“terraform.ui”,“@timestamp”:“2024-01-03T11:54:11.330155Z”,“diagnostic”:{“severity”:“error”,“summary”:“Client Error”,“detail”:“unable to find team member”},“type”:“diagnostic”} Operation failed: failed running terraform plan (exit 1) terraform cloud plan

Any help?

@jianyuan
Copy link
Owner

It seems to be related to #364

@jianyuan
Copy link
Owner

I have devised a fix. I will be releasing v0.12.2 shortly.

@deiga
Copy link

deiga commented Jan 26, 2024

@jianyuan You didn't release the tag and it can't be found by terraform, please release the fix 🙏

@jianyuan
Copy link
Owner

@deiga Whoops, forgot to click Publish 🤦 . It's out now! Thanks for letting me know!

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

3 participants