-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
IAM custom role creation fails due to invalid argument (badRequest) #4717
Comments
I will need your debug logs to help further - this issue doesn't occur in our unit tests. |
Here is what I believe to be the relevant snippet of my debug log. Let me know if additional information is required - thank you for taking a look! |
We're seeing this exact same issue, only the last week or so, and with terraform 0.11.7, and provider version 1.16.0. We haven't tried bumping the provider version yet, but the TF version in the original issue implies that even later providers have this problem. |
Are you able to do that in the cloud console? In your log it looks like you're trying to add |
@ndmckinley I verified that myCustomRole actually does get created by terraform. The issue is with adding a user to that specific role, as per the below terraform:
Am I just going about the membership incorrectly? I was able to perform the above action in the UI without issue, granted I was not acting on behalf of the service account obviously. |
@snoozesecurity what version of the provider were you using? If that was old, can you try again using the latest version? Please provide the new full debug log if you can repro this issue. |
@snoozesecurity your above code works for me. both customrole and iam binding are showed up in the gcp console. I am closing this issue. Please feel free to reopen it if you need further assistance. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform v0.12.12
Affected Resource(s)
main.tf
Expected Behavior
I would expect the role to be created since my service account has the proper permissions.
Actual Behavior
terraform apply
fails. Snippet of the error message:400: Request contains an invalid argument., badRequest
on main.tf line 15, in resource "google_project_iam_member" "custom_membership":
15: resource "google_project_iam_member" "custom_membership" {
(note that the final '{' symbol is underlined in stdout)
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: