Skip to main content

policy_generations

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

Overview

Namepolicy_generations
TypeResource
Idaws.accessanalyzer.policy_generations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
completed_onstring (date-time)A timestamp of when the policy generation was completed.
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.
principal_arnstringThe ARN of the IAM entity (user or role) for which you are generating a policy. (pattern: <code>arn:[^:]:iam::[^:]:(role|user)/.{1,576}</code>)
started_onstring (date-time)A timestamp of when the policy generation started.
statusstringThe status of the policy generation request. (IN_PROGRESS, SUCCEEDED, FAILED, CANCELED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_policy_generationsselectregionprincipalArn, maxResults, nextTokenLists all of the policy generations requested in the last seven days.

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
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in the response.
nextTokenstringA token used for pagination of results returned.
principalArnstringThe ARN of the IAM entity (user or role) for which you are generating a policy. Use this with ListGeneratedPolicies to filter the results to only include results for a specific principal.

SELECT examples

Lists all of the policy generations requested in the last seven days.

SELECT
completed_on,
job_id,
principal_arn,
started_on,
status
FROM aws.accessanalyzer.policy_generations
WHERE region = '{{ region }}' -- required
AND principalArn = '{{ principalArn }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;