Googleworkspace: specify multiple members dynamically from a variable

I know that using “googleworkspace_group_member” (singular). I can use “for_each” and create dynamically multiple resources (one per account to grant the membership)

I would like to use “googleworkspace_group_members” (plural) because I can specify the membership in a single resource. I can do it fine if I write the “members” manually. However, I would like to generate them using a variable. Can I do that? How can I do it?

Thank you very much

https://registry.terraform.io/providers/hashicorp/googleworkspace/latest/docs/resources/group_members

Yes, but the syntax is a bit non-obvious.

You need to refer to Dynamic Blocks - Configuration Language | Terraform | HashiCorp Developer

1 Like

Great, thank you very much this worked.