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

googleworkspace_users - Error 400: Bad Request #482

Open
OguzhanKuloglu opened this issue May 13, 2024 · 0 comments
Open

googleworkspace_users - Error 400: Bad Request #482

OguzhanKuloglu opened this issue May 13, 2024 · 0 comments

Comments

@OguzhanKuloglu
Copy link

OguzhanKuloglu commented May 13, 2024

Hi there, I have a bad request for a specific data source.

Terraform Version

version = "~> 0.7"

Affected Resource(s)

data "googleworkspace_users" "mygoogleusers" {}

output "num_users" {
value = data.googleworkspace_users.mygoogleusers.users
}

For this data source, I always get bad request 404 without any description.

But Using other data sources for example

data "googleworkspace_group" "mail_group" {
for_each = toset(var.mail_groups)
email = each.value
}

data "googleworkspace_group_members" "members" {
for_each = data.googleworkspace_group.mail_group
group_id = each.value.id
}

data "googleworkspace_user" "user_details" {
for_each = {
for idx, member in flatten([
for group in data.googleworkspace_group_members.members : group.members
]) : "${member.email}-${idx}" => member
}
primary_email = split("-", each.key)[0]
}

output "user_details" {
value = { for email, details in data.googleworkspace_user.user_details : email => details.suspended }
}

Debug Output

│ Error: Error when reading or editing users: googleapi: Error 400: Bad Request, badRequest
│ 
│   with module.google_workspace.data.googleworkspace_users.mygoogleusers,
│   on ../../modules/google_workspace/main.tf line 34, in data "googleworkspace_users" "mygoogleusers":
│   34: data "googleworkspace_users" "mygoogleusers" {}

I couldn't figure out and find a relative issue about it, Could you please check out?

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

1 participant