- NAME
-
- gcloud asset get-effective-iam-policy - get effective IAM policies for a specified list of resources within accessible scope, such as a project, folder or organization
- SYNOPSIS
-
-
gcloud asset get-effective-iam-policy
--names
=NAMES
,[NAMES
,…]--scope
=SCOPE
[GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
- Batch get effective IAM policies that match a request.
- EXAMPLES
-
To list effective IAM policies of 1 resource in an organization, run:
gcloud asset get-effective-iam-policy --scope=organizations/YOUR_ORG_ID --names=RESOURCE_NAME1
To list effective IAM policies of 2 resources in a folder, run:
gcloud asset get-effective-iam-policy --scope=folders/YOUR_FOLDER_ID --names=RESOURCE_NAME1,RESOURCE_NAME2
To list effective IAM policies of 3 resources in a project using project ID, run:
gcloud asset get-effective-iam-policy --scope=projects/YOUR_PROJECT_ID --names=RESOURCE_NAME1,RESOURCE_NAME2,RESOURCE_NAME3
To list effective IAM policies of 2 resources in a project using project number, run:
gcloud asset get-effective-iam-policy --scope=projects/YOUR_PROJECT_NUMBER --names=RESOURCE_NAME1,RESOURCE_NAME2
- REQUIRED FLAGS
-
--names
=NAMES
,[NAMES
,…]-
Names refer to a list of full
resource names of searchable
asset types. For each batch call, total number of names provided is between
1 and 20.
The example value is:
-
//cloudsql.googleapis.com/projects/{PROJECT_ID}/instances/{INSTANCE}
(e.g.
)//cloudsql.googleapis.com/projects/probe-per-rt-project/instances/instance1
-
--scope
=SCOPE
-
Scope can be a project, a folder, or an organization. The search is limited to
the IAM policies within this scope. The caller must be granted the
,cloudasset.assets.analyzeIamPolicy
,cloudasset.assets.searchAllResources
permissions on the desired scope.cloudasset.assets.searchAllIamPolicies
The allowed values are:
-
projects/{PROJECT_ID}
(e.g.
)projects/foo-bar
-
projects/{PROJECT_NUMBER}
(e.g.
)projects/12345678
-
folders/{FOLDER_NUMBER}
(e.g.
)folders/1234567
-
organizations/{ORGANIZATION_NUMBER}
(e.g.
)organizations/123456
-
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file
,--account
,--billing-project
,--configuration
,--flags-file
,--flatten
,--format
,--help
,--impersonate-service-account
,--log-http
,--project
,--quiet
,--trace-token
,--user-output-enabled
,--verbosity
.Run
$ gcloud help
for details.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"last_modified": "Last updated 2024-02-06 UTC.",
"state": ""
}