iam/apiv1: allow GetIamPolicy and GetIamPolicy on Service Account resources #11320
Labels
api: iam
Issues related to the Identity and Access Management API.
type: question
Request for information or clarification. Not an issue.
Is your feature request related to a problem? Please describe.
I need to update the IAM policy of a ServiceAccount resource and currently I couldn't find any way to do it using the google-cloud-go.
I could find documentation on how to do it using gcloud client libraries in Python and Java, but not for Go.
Describe the solution you'd like
The solution I'd like is basically allow using https://pkg.go.dev/cloud.google.com/go/iam@v1.3.0/apiv1#example-IamPolicyClient.GetIamPolicy with a Service Account as a resource.
This is an example on how I tried to do so:
But I repeatedly get this error::
I could observe this behavior on the version v1.1.13, that I usually work with, but also in latest (v1.3.0)
Describe alternatives you've considered
Weirdly enough, I could make it work using the library google.golang.org/api, but it's considered complete and it's only on maintenance mode. I followed the exemple here: https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/getIamPolicy#go
Additional context
Similar issue: #8671
The text was updated successfully, but these errors were encountered: