- gcloud alpha asset search-iam-policies - searches accessible IAM policies that match a query
(ALPHA)Searches accessible IAM policies that match a query.
- REQUIRED FLAGS
The query statement.
Examples: To find all Cloud IAM policies in your organization that contain firstname.lastname@example.org: 'policy:"email@example.com"'
To find all Cloud IAM policies in your organization that contain owner role: 'policy:"roles/owner"'
To find all Cloud IAM policies in your organization which have firstname.lastname@example.org in the owner role: 'policy:("roles/owner" "email@example.com")'
To find all Cloud IAM policies in your organization which have firstname.lastname@example.org in the owner role or email@example.com in the viewer role: 'policy:(("roles/owner" "firstname.lastname@example.org") OR ("roles/viewer" "email@example.com"))'
To find all Cloud IAM policies that are set on a resource: 'resource: "projects/123"'
To find all Cloud IAM policies of resources that match a query. 'resource: "
- OPTIONAL FLAGS
- The page size for search result pagination. The number of matching results may be fewer than requested based on the query. The maximum page size is 2000. If page-size is not given the back end will pick an appropriate default page size.
If present, retrieve the next batch of results from the preceding call to this
page_tokenmust be the value of
next_page_tokenfrom the previous response. The values of all other method parameters must be identical to those in the previous call.
- GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account,
--log-http, --project, --quiet, --trace-token, --user-output-enabled,
$ gcloud helpfor details.
- API REFERENCE
This command uses the
cloudasset/v1p1alpha1API. The full documentation for this API can be found at: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory
To search your accessible IAM policies that contains
$ gcloud alpha asset search-iam-policies \ --query='policy:"firstname.lastname@example.org"'
- This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you may be trying to access an API with an invitation-only early access whitelist. This variant is also available:
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 2020-01-21.