Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in GCP by (29.3k points)

How to create a service account on GCP using a python script calling the REST API and then give it specific roles?

Here are the steps that I have followed:

First I have created a request to create the account which works fine and I can see the account.

Second, added it to the role in the right method. However, and saying:

 HttpError 400, "Role roles/logging.logWriter is not supported for this resource."

Any idea how to add scripting to a role for a service account using the API?

1 Answer

0 votes
by (50.2k points)

Here as per the steps that you are following, you are trying to set a role on the service account as a resource but this will help you to create/restrict only to use the service account.

If you want to give a service account, you can achieve the task by creating the role.

For more details, refer to the below tutorial on google cloud training.  

Browse Categories

...