Hello people!
I am digging in to the documentation related to gcp nodejs sdk, but I cannot find anything related to get/list/update/delete custom roles using the nodejs sdk. I am using @Google-gcp/iam npm package, but I only can get information related to policies. I have noticed that for other languajes there is a different library called iam-admin or thing like that and it allows to do the things that I want. I wonder if that methods are in a different package. Can you help me?
Thank you in advance!
Hi @lucastrustle,
Welcome to the Google Cloud Community!
Unfortunately, I believe it's not possible to get, list, update, or delete custom roles with the @Google-cloud/iam
library. Instead, you may want to use the more general-purpose package which is googleapis
. Here is the link to the official documentation.
You can install the library by running the command[1]:
npm install googleapis
From there, you may want to utilize the organizations.roles
[2] or the projects.roles
[3] methods.
I hope this answers your question. Thanks.
[1]. https://cloud.google.com/iam/docs/reference/libraries#iam-client-libraries-install-nodejs
[2]. https://cloud.google.com/iam/docs/reference/rest/v1/organizations.roles
[3]. https://cloud.google.com/iam/docs/reference/rest/v1/projects.roles