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

Error when adding an entire domain as member #457

Open alepuccetti opened 1 year ago

alepuccetti commented 1 year ago

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v1.5.2
+ provider registry.terraform.io/hashicorp/google v4.70.0
+ provider registry.terraform.io/hashicorp/googleworkspace v0.7.0

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "googleworkspace_group_members" "employees-test" {
  group_id = googleworkspace_group.employees-test.email

  members {
    email             = "onwer-1@example.com"
    role              = "OWNER"
    type              = "USER"
    delivery_settings = "ALL_MAIL"
  }
  members {
    email             = "onwer-2@example.com"
    role              = "OWNER"
    type              = "USER"
    delivery_settings = "ALL_MAIL"
  }
  members {
    email             = "<CUSTOMER_ID>"   # This is coped from the admin console 
    role              = "MEMBER"
    type              = "CUSTOMER"
    delivery_settings = "ALL_MAIL"
  }

  depends_on = [
    googleworkspace_group.employees-test
  ]
}

Expected Behavior

As per the docs here https://registry.terraform.io/providers/hashicorp/googleworkspace/latest/docs/resources/group_members#type. It should add all all the user within the domain to the group

Actual Behavior

Plan works fine but apply fail with this error:

Error: googleapi: Error 400: Invalid Input: memberKey, invalid
with googleworkspace_group_members.employees-test
on groups.tf line 89, in resource "googleworkspace_group_members" "employees-test":

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply