I am trying to attach a IAM role to a GCP service ...
# google-cloud
b
I am trying to attach a IAM role to a GCP service account , created via
pulumi
. for example if i want to make the service account
storage.Admin
using
serviceaccount.NewIAMMember
. roles are given as below ā€¢ roles/storage.admin ā€¢ projects/<projectName>/roles/storage.admin Both threw error
400
Copy code
does not exist in the resource's hierarchy., badRequest
when i try using
NewIAMBinding
below is the error ..
Copy code
Error setting IAM policy for service account 'projects/<project-name>/serviceAccounts/<sa-email>': googleapi: Error 400: Role roles/storage.admin is not supported for this resource., badRequest
w
A 400 error like that indicates Google is sending back the error. And it looks like google does not allow assigning storage.admin role to that service account. One thing you could try is doing the same assignment through the GCP portal and see what, if any, error messages you get from the portal.
šŸ‘šŸ½ 1
b
Thank you @witty-candle-66007
328 Views