ciao_bella
ciao_bella

Reputation: 41

GCP Request is prohibited by organization's policy

I'm trying to extract some information from GCP. I use this command gcloud asset search-all-resources --scope=projects/projID

But it gives me VPC_SERVICE_CONTROLS error:

User does not have permission to access projects instance (or it may not exist): Request is prohibited by organization's policy. 

I tried troubleshooting and checked all permissions but everything's fine. Strange fact is that it works with other projects and other environments. Do I need some special configurations?

Upvotes: 1

Views: 13633

Answers (1)

Catherine O
Catherine O

Reputation: 1011

To search all cloud resources within the specified scope, the caller must be granted cloudasset.assets.searchAllResources permission on the desired scope (can be a project, a folder or an organization). If not specified, the configured project property will be used.

By running, gcloud config get project you'll find the configured project and to change the project, run: gcloud config set project [PROJECT_ID]

You may find the official documentation here.

Upvotes: 1

Related Questions