hashicorp / terraform-provider-googleworkspace

Terraform Provider for Google Workspace
https://registry.terraform.io/providers/hashicorp/googleworkspace
Mozilla Public License 2.0
129 stars 56 forks source link

Add ALL_OWNERS_CAN_LEAVE for who_can_leave_group #460

Open ivankovnatsky opened 1 year ago

ivankovnatsky commented 1 year ago

We are working to import google resources and I see that existing value for one of our groups is ALL_OWNERS_CAN_LEAVE.

  # googleworkspace_group_settings.this["<obfuscated>"] will be updated in-place
  ~ resource "googleworkspace_group_settings" "this" {
        id                                             = "<obfuscated>@<obfuscated>"
        name                                           = "<obfuscated>"
      ~ who_can_leave_group                            = "ALL_OWNERS_CAN_LEAVE" -> "ALL_MEMBERS_CAN_LEAVE"
        # (24 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

If I change to it, provider crashes with:

│ Error: expected who_can_leave_group to be one of [ALL_MANAGERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE NONE_CAN_LEAVE], got ALL_OWNERS_CAN_LEAVE
│
│   with googleworkspace_group_settings.this["<obfuscated>"],
│   on groups.tf line 26, in resource "googleworkspace_group_settings" "this":
│   26:   who_can_leave_group        = try(each.value.who_can_leave_group, null)

Tested with built provider and the diff went away, should be fine I think.