Skip to main content

generated_policies

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

Overview

Namegenerated_policies
TypeResource
Idaws.accessanalyzer.generated_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
generated_policy_resultobjectA GeneratedPolicyResult object that contains the generated policies and associated details.
job_detailsobjectA GeneratedPolicyDetails object that contains details about the generated policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_generated_policyselectjob_id, regionincludeResourcePlaceholders, includeServiceLevelTemplateRetrieves the policy that was generated using StartPolicyGeneration.

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
job_idstringThe JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
regionstringAWS region (default: us-east-1)
includeResourcePlaceholdersbooleanThe level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies. For example, in the resource section of a policy, you can receive a placeholder such as "Resource":"arn:aws:s3:::${BucketName}" instead of "*".
includeServiceLevelTemplatebooleanThe level of detail that you want to generate. You can specify whether to generate service-level policies. IAM Access Analyzer uses iam:servicelastaccessed to identify services that have been used recently to create this service-level template.

SELECT examples

Retrieves the policy that was generated using StartPolicyGeneration.

SELECT
generated_policy_result,
job_details
FROM aws.accessanalyzer.generated_policies
WHERE job_id = '{{ job_id }}' -- required
AND region = '{{ region }}' -- required
AND includeResourcePlaceholders = '{{ includeResourcePlaceholders }}'
AND includeServiceLevelTemplate = '{{ includeServiceLevelTemplate }}'
;