hirosassa / terraform-provider-looker

Terraform Provider for managing Looker
https://registry.terraform.io/providers/hirosassa/looker/latest
MIT License
20 stars 13 forks source link

Cannot delete user attribute values when type string #31

Closed marcoquerque closed 2 years ago

marcoquerque commented 2 years ago

Getting this error when attempting to delete a user attribute value

│ Error: response error. status=422 Unprocessable Entity. error={"message":"Validation Failed","errors":[{"field":"value","code":"invalid","message":"String value cannot be nil","documentation_url":"https://docs.looker.com/"}],"documentation_url":"https://docs.looker.com/"}
│ 
│ 
╵

e.g.

resource "looker_user" "looker_user" {

  email      = "marco.albuquerque@carta.com"
  first_name = "Marco"
  last_name  = "Albuquerque"

}

resource "looker_user_attribute" "access_area" {

  name          = "view_pii"
  label         = "view_pii"
  type          = "string"
  user_can_edit = false
  user_can_view = true

}

resource "looker_user_attribute_user_value" "access_area" {

  user_id           = looker_user.looker_user.id
  user_attribute_id = looker_user_attribute.access_area.id
  value             = "yes"

}

Example Plan

  # module.looker_users.looker_user_attribute.access_areas["marco.albuquerque@carta.com/PII"] will be destroyed
  # (because key ["marco.albuquerque@carta.com/PII"] is not in for_each map)
  - resource "looker_user_attribute" "access_areas" {
      - id              = "18" -> null
      - label           = "view_pii" -> null
      - name            = "view_pii" -> null
      - type            = "string" -> null
      - user_can_edit   = false -> null
      - user_can_view   = true -> null
      - value_is_hidden = false -> null
    }
marcoquerque commented 2 years ago

Also I am using provider version 0.8.6

hirosassa commented 2 years ago

@marcoquerque Thanks for your info! I'll take a look on this weekend. Wait a sec!

marcoquerque commented 2 years ago

@hirosassa - Am I able to get access to propose changes here? Does this need to be via a forked repos? or is there a way I can do that via a branch in this repos. What is your preferred method!

hirosassa commented 2 years ago

@marcoquerque Thanks! If you create your changes to this repo, please fork this repo and do your magic 🧙 in the fork then create a PR to this repo. I'll review ASAP.

marcoquerque commented 2 years ago

I have three PRs up @hirosassa (Including one for this Issue).

Looks like my workflows aren't running - let me know how to proceed :)