Given a Service Account that is assigned a Custom Role with a large number of permissions (All of them are readonly, so it’s basically a subset of the Viewer Role)
How would I go about determining all the Services/APIs that need to be enabled from the permissions granted to ensure that the permissions can actually be used?
I tried using the services.get method from the ServiceUsage API and that method does return a list of APIs it supports for some Services while for others that list is not available. Moreover I’m unable to accurately map the APIs supported to the permissions.
“Method: services.list” [1] can lists all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the servicemanagement.services.bind permission, and all services that have already been enabled on the project.
I checked public documentation and internal documentation; There is no way to see 1:1 what API are enabled that the Service Account has access to. If you would like we can open a feature request [1]. However, there is no ETA on when and if the feature will be implemented. For now, you would have to cross reference all APIs that are enabled or not. Additionally, if you have a list of APIs you want to enable in batch, you can use “Method: services.batchEnable” [2].