generated_policies
Creates, updates, deletes, gets or lists a generated_policies resource.
Overview
| Name | generated_policies |
| Type | Resource |
| Id | aws.accessanalyzer.generated_policies |
Fields
The following fields are returned by SELECT queries:
- get_generated_policy
| Name | Datatype | Description |
|---|---|---|
generated_policy_result | object | A GeneratedPolicyResult object that contains the generated policies and associated details. |
job_details | object | A GeneratedPolicyDetails object that contains details about the generated policy. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_generated_policy | select | job_id, region | includeResourcePlaceholders, includeServiceLevelTemplate | Retrieves 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.
| Name | Datatype | Description |
|---|---|---|
job_id | string | The 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. |
region | string | AWS region (default: us-east-1) |
includeResourcePlaceholders | boolean | The 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 "*". |
includeServiceLevelTemplate | boolean | The 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
- get_generated_policy
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 }}'
;