AccessAnalyzer / Client / list_policy_generations

list_policy_generations#

AccessAnalyzer.Client.list_policy_generations(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.list_policy_generations(
    principalArn='string',
    maxResults=123,
    nextToken='string'
)
Parameters:
  • principalArn (string) – The 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.

  • maxResults (integer) – The maximum number of results to return in the response.

  • nextToken (string) – A token used for pagination of results returned.

Return type:

dict

Returns:

Response Syntax

{
    'policyGenerations': [
        {
            'jobId': 'string',
            'principalArn': 'string',
            'status': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'CANCELED',
            'startedOn': datetime(2015, 1, 1),
            'completedOn': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • policyGenerations (list) –

      A PolicyGeneration object that contains details about the generated policy.

      • (dict) –

        Contains details about the policy generation status and properties.

        • jobId (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.

        • principalArn (string) –

          The ARN of the IAM entity (user or role) for which you are generating a policy.

        • status (string) –

          The status of the policy generation request.

        • startedOn (datetime) –

          A timestamp of when the policy generation started.

        • completedOn (datetime) –

          A timestamp of when the policy generation was completed.

    • nextToken (string) –

      A token used for pagination of results returned.

Exceptions

  • AccessAnalyzer.Client.exceptions.ValidationException

  • AccessAnalyzer.Client.exceptions.InternalServerException

  • AccessAnalyzer.Client.exceptions.ThrottlingException

  • AccessAnalyzer.Client.exceptions.AccessDeniedException