Skip to main content

cloudasset_iam_policies

Creates, updates, deletes, gets or lists a cloudasset_iam_policies resource.

Overview

Namecloudasset_iam_policies
TypeResource
Idgoogle.cloudasset.cloudasset_iam_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
policyResultsarrayThe effective policies for a batch of resources. Note that the results order is the same as the order of BatchGetEffectiveIamPoliciesRequest.names. When a resource does not have any effective IAM policies, its corresponding policy_result will contain empty EffectiveIamPolicy.policies.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_getselectscopenamesGets effective IAM policies for a batch of resources.
analyze_iam_policy_longrunningexecscopeAnalyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse. This method implements the google.longrunning.Operation, which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
scopestring
namesstring

SELECT examples

Gets effective IAM policies for a batch of resources.

SELECT
policyResults
FROM google.cloudasset.cloudasset_iam_policies
WHERE scope = '{{ scope }}' -- required
AND names = '{{ names }}';

Lifecycle Methods

Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse. This method implements the google.longrunning.Operation, which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

EXEC google.cloudasset.cloudasset_iam_policies.analyze_iam_policy_longrunning 
@scope='{{ scope }}' --required
@@json=
'{
"analysisQuery": "{{ analysisQuery }}",
"savedAnalysisQuery": "{{ savedAnalysisQuery }}",
"outputConfig": "{{ outputConfig }}"
}';