Skip to content

Add information about failing member into the error message #3507

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

Conversation

modular-magician
Copy link
Collaborator

When working with dynamically generated list of IAM resources, the error message is not that useful:

Error: invalid value for member (IAM members must have one of the values outlined here: https://cloud.google.com/billing/docs/reference/rest/v1/Policy#Binding)

  with module.projects-iam["service1"].google_project_iam_member.shared_vpc_host_iam["rw"],
  on ../project/shared-vpc.tf line 131, in resource "google_project_iam_member" "shared_vpc_host_iam":
 131:   member     = each.value

It makes hard to actually identify offending value. Returning failing member value helps to narrow down, which value was passed incorrectly.

See Write release notes for guidance.

iam: added member value to the error message when member validation fails for google_project_iam_*

Derived from GoogleCloudPlatform/magic-modules#13146

[upstream:649cf636d383a90e4ab23a38f4a34e49b3de305d]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner February 24, 2025 23:08
@modular-magician modular-magician requested review from shuyama1 and removed request for a team February 24, 2025 23:08
@modular-magician modular-magician merged commit b17024b into GoogleCloudPlatform:main Feb 24, 2025
5 of 7 checks passed
kotatut pushed a commit to kotatut/terraform-google-conversion-antonkot that referenced this pull request Apr 18, 2025
…oogleCloudPlatform#3507)

[upstream:649cf636d383a90e4ab23a38f4a34e49b3de305d]

Signed-off-by: Modular Magician <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant