AWS Identity and Access Management

2015/03/26 - AWS Identity and Access Management - 2 updated api methods

GetAccountAuthorizationDetails (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'AWSManagedPolicy', 'LocalManagedPolicy'}}
Response
{'GroupDetailList': {'AttachedManagedPolicies': [{'PolicyArn': 'string',
                                                  'PolicyName': 'string'}]},
 'Policies': [{'Arn': 'string',
               'AttachmentCount': 'integer',
               'CreateDate': 'timestamp',
               'DefaultVersionId': 'string',
               'Description': 'string',
               'IsAttachable': 'boolean',
               'Path': 'string',
               'PolicyId': 'string',
               'PolicyName': 'string',
               'PolicyVersionList': [{'CreateDate': 'timestamp',
                                      'Document': 'string',
                                      'IsDefaultVersion': 'boolean',
                                      'VersionId': 'string'}],
               'UpdateDate': 'timestamp'}],
 'RoleDetailList': {'AttachedManagedPolicies': [{'PolicyArn': 'string',
                                                 'PolicyName': 'string'}]},
 'UserDetailList': {'AttachedManagedPolicies': [{'PolicyArn': 'string',
                                                 'PolicyName': 'string'}]}}

Retrieves information about all IAM users, groups, and roles in your account, including their relationships to one another and their policies. Use this API to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account.

You can optionally filter the results using the Filter parameter. You can paginate the results using the MaxItems and Marker parameters.

Request Syntax

client.get_account_authorization_details(
    Filter=[
        'User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
    ],
    MaxItems=123,
    Marker='string'
)
type Filter

list

param Filter

A list of entity types (user, group, role, local managed policy, or AWS managed policy) for filtering the results.

  • (string) --

type MaxItems

integer

param MaxItems

Use this only when paginating results to indicate the maximum number of items you want in the response. If there are additional items beyond the maximum you specify, the IsTruncated response element is true . This parameter is optional. If you do not include it, it defaults to 100.

type Marker

string

param Marker

Use this only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.

rtype

dict

returns

Response Syntax

{
    'UserDetailList': [
        {
            'Path': 'string',
            'UserName': 'string',
            'UserId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'UserPolicyList': [
                {
                    'PolicyName': 'string',
                    'PolicyDocument': 'string'
                },
            ],
            'GroupList': [
                'string',
            ],
            'AttachedManagedPolicies': [
                {
                    'PolicyName': 'string',
                    'PolicyArn': 'string'
                },
            ]
        },
    ],
    'GroupDetailList': [
        {
            'Path': 'string',
            'GroupName': 'string',
            'GroupId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'GroupPolicyList': [
                {
                    'PolicyName': 'string',
                    'PolicyDocument': 'string'
                },
            ],
            'AttachedManagedPolicies': [
                {
                    'PolicyName': 'string',
                    'PolicyArn': 'string'
                },
            ]
        },
    ],
    'RoleDetailList': [
        {
            'Path': 'string',
            'RoleName': 'string',
            'RoleId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'AssumeRolePolicyDocument': 'string',
            'InstanceProfileList': [
                {
                    'Path': 'string',
                    'InstanceProfileName': 'string',
                    'InstanceProfileId': 'string',
                    'Arn': 'string',
                    'CreateDate': datetime(2015, 1, 1),
                    'Roles': [
                        {
                            'Path': 'string',
                            'RoleName': 'string',
                            'RoleId': 'string',
                            'Arn': 'string',
                            'CreateDate': datetime(2015, 1, 1),
                            'AssumeRolePolicyDocument': 'string'
                        },
                    ]
                },
            ],
            'RolePolicyList': [
                {
                    'PolicyName': 'string',
                    'PolicyDocument': 'string'
                },
            ],
            'AttachedManagedPolicies': [
                {
                    'PolicyName': 'string',
                    'PolicyArn': 'string'
                },
            ]
        },
    ],
    'Policies': [
        {
            'PolicyName': 'string',
            'PolicyId': 'string',
            'Arn': 'string',
            'Path': 'string',
            'DefaultVersionId': 'string',
            'AttachmentCount': 123,
            'IsAttachable': True|False,
            'Description': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'UpdateDate': datetime(2015, 1, 1),
            'PolicyVersionList': [
                {
                    'Document': 'string',
                    'VersionId': 'string',
                    'IsDefaultVersion': True|False,
                    'CreateDate': datetime(2015, 1, 1)
                },
            ]
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a successful GetAccountAuthorizationDetails request.

    • UserDetailList (list) --

      A list containing information about IAM users.

      • (dict) --

        Contains information about an IAM user, including all the user's policies and all the IAM groups the user is in.

        This data type is used as a response element in the GetAccountAuthorizationDetails action.

        • Path (string) --

          The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.

        • UserName (string) --

          The friendly name identifying the user.

        • UserId (string) --

          The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.

        • Arn (string) --

          The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

          For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

        • CreateDate (datetime) --

          The date and time, in ISO 8601 date-time format, when the user was created.

        • UserPolicyList (list) --

          A list of the inline policies embedded in the user.

          • (dict) --

            Contains information about an IAM policy, including the policy document.

            This data type is used as a response element in the GetAccountAuthorizationDetails action.

            • PolicyName (string) --

              The name of the policy.

            • PolicyDocument (string) --

              The policy document.

              The returned policy is URL-encoded according to RFC 3986.

        • GroupList (list) --

          A list of IAM groups that the user is in.

          • (string) --

        • AttachedManagedPolicies (list) --

          A list of the managed policies attached to the user.

          • (dict) --

            Contains information about an attached policy.

            An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails actions.

            For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

            • PolicyName (string) --

              The friendly name of the attached policy.

            • PolicyArn (string) --

              The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

              For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

    • GroupDetailList (list) --

      A list containing information about IAM groups.

      • (dict) --

        Contains information about an IAM group, including all of the group's policies.

        This data type is used as a response element in the GetAccountAuthorizationDetails action.

        • Path (string) --

          The path to the group. For more information about paths, see IAM Identifiers in the Using IAM guide.

        • GroupName (string) --

          The friendly name that identifies the group.

        • GroupId (string) --

          The stable and unique string identifying the group. For more information about IDs, see IAM Identifiers in the Using IAM guide.

        • Arn (string) --

          The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

          For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

        • CreateDate (datetime) --

          The date and time, in ISO 8601 date-time format, when the group was created.

        • GroupPolicyList (list) --

          A list of the inline policies embedded in the group.

          • (dict) --

            Contains information about an IAM policy, including the policy document.

            This data type is used as a response element in the GetAccountAuthorizationDetails action.

            • PolicyName (string) --

              The name of the policy.

            • PolicyDocument (string) --

              The policy document.

              The returned policy is URL-encoded according to RFC 3986.

        • AttachedManagedPolicies (list) --

          A list of the managed policies attached to the group.

          • (dict) --

            Contains information about an attached policy.

            An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails actions.

            For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

            • PolicyName (string) --

              The friendly name of the attached policy.

            • PolicyArn (string) --

              The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

              For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

    • RoleDetailList (list) --

      A list containing information about IAM roles.

      • (dict) --

        Contains information about an IAM role, including all of the role's policies.

        This data type is used as a response element in the GetAccountAuthorizationDetails action.

        • Path (string) --

          The path to the role. For more information about paths, see IAM Identifiers in the Using IAM guide.

        • RoleName (string) --

          The friendly name that identifies the role.

        • RoleId (string) --

          The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the Using IAM guide.

        • Arn (string) --

          The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

          For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

        • CreateDate (datetime) --

          The date and time, in ISO 8601 date-time format, when the role was created.

        • AssumeRolePolicyDocument (string) --

          The trust policy that grants permission to assume the role.

          The returned policy is URL-encoded according to RFC 3986.

        • InstanceProfileList (list) --

          Contains a list of instance profiles.

          • (dict) --

            Contains information about an instance profile.

            This data type is used as a response element in the following actions:

            • CreateInstanceProfile

            • GetInstanceProfile

            • ListInstanceProfiles

            • ListInstanceProfilesForRole

            • Path (string) --

              The path to the instance profile. For more information about paths, see IAM Identifiers in the Using IAM guide.

            • InstanceProfileName (string) --

              The name identifying the instance profile.

            • InstanceProfileId (string) --

              The stable and unique string identifying the instance profile. For more information about IDs, see IAM Identifiers in the Using IAM guide.

            • Arn (string) --

              The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM Identifiers in the Using IAM guide.

            • CreateDate (datetime) --

              The date when the instance profile was created.

            • Roles (list) --

              The role associated with the instance profile.

              • (dict) --

                Contains information about an IAM role.

                This data type is used as a response element in the following actions:

                • CreateRole

                • GetRole

                • ListRoles

                • Path (string) --

                  The path to the role. For more information about paths, see IAM Identifiers in the Using IAM guide.

                • RoleName (string) --

                  The friendly name that identifies the role.

                • RoleId (string) --

                  The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the Using IAM guide.

                • Arn (string) --

                  The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM Identifiers in the Using IAM guide.

                • CreateDate (datetime) --

                  The date and time, in ISO 8601 date-time format, when the role was created.

                • AssumeRolePolicyDocument (string) --

                  The policy that grants an entity permission to assume the role.

                  The returned policy is URL-encoded according to RFC 3986.

        • RolePolicyList (list) --

          A list of inline policies embedded in the role. These policies are the role's access (permissions) policies.

          • (dict) --

            Contains information about an IAM policy, including the policy document.

            This data type is used as a response element in the GetAccountAuthorizationDetails action.

            • PolicyName (string) --

              The name of the policy.

            • PolicyDocument (string) --

              The policy document.

              The returned policy is URL-encoded according to RFC 3986.

        • AttachedManagedPolicies (list) --

          A list of managed policies attached to the role. These policies are the role's access (permissions) policies.

          • (dict) --

            Contains information about an attached policy.

            An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails actions.

            For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

            • PolicyName (string) --

              The friendly name of the attached policy.

            • PolicyArn (string) --

              The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

              For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

    • Policies (list) --

      A list containing information about managed policies.

      • (dict) --

        Contains information about a managed policy, including the policy's ARN, versions, and the number of principal entities (users, groups, and roles) that the policy is attached to.

        This data type is used as a response element in the GetAccountAuthorizationDetails action.

        For more information about managed policies, see Managed Policies and Inline Policies in the Using IAM guide.

        • PolicyName (string) --

          The friendly name (not ARN) identifying the policy.

        • PolicyId (string) --

          The stable and unique string identifying the policy.

          For more information about IDs, see IAM Identifiers in the Using IAM guide.

        • Arn (string) --

          The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

          For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

        • Path (string) --

          The path to the policy.

          For more information about paths, see IAM Identifiers in the Using IAM guide.

        • DefaultVersionId (string) --

          The identifier for the version of the policy that is set as the default (operative) version.

          For more information about policy versions, see Versioning for Managed Policies in the Using IAM guide.

        • AttachmentCount (integer) --

          The number of principal entities (users, groups, and roles) that the policy is attached to.

        • IsAttachable (boolean) --

          Specifies whether the policy can be attached to an IAM user, group, or role.

        • Description (string) --

          A friendly description of the policy.

        • CreateDate (datetime) --

          The date and time, in ISO 8601 date-time format, when the policy was created.

        • UpdateDate (datetime) --

          The date and time, in ISO 8601 date-time format, when the policy was last updated.

          When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.

        • PolicyVersionList (list) --

          A list containing information about the versions of the policy.

          • (dict) --

            Contains information about a version of a managed policy.

            This data type is used as a response element in the CreatePolicyVersion, GetPolicyVersion, ListPolicyVersions, and GetAccountAuthorizationDetails actions.

            For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

            • Document (string) --

              The policy document.

              The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

            • VersionId (string) --

              The identifier for the policy version.

              Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .

            • IsDefaultVersion (boolean) --

              Specifies whether the policy version is set as the policy's default version.

            • CreateDate (datetime) --

              The date and time, in ISO 8601 date-time format, when the policy version was created.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items.

    • Marker (string) --

      If IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

ListEntitiesForPolicy (updated) Link ¶
Changes (request)
{'EntityFilter': {'AWSManagedPolicy', 'LocalManagedPolicy'}}

Lists all users, groups, and roles that the specified managed policy is attached to.

You can use the optional EntityFilter parameter to limit the results to a particular type of entity (users, groups, or roles). For example, to list only the roles that are attached to the specified policy, set EntityFilter to Role .

You can paginate the results using the MaxItems and Marker parameters.

Request Syntax

client.list_entities_for_policy(
    PolicyArn='string',
    EntityFilter='User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PolicyArn

string

param PolicyArn

[REQUIRED]

The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference .

type EntityFilter

string

param EntityFilter

The entity type to use for filtering the results.

For example, when EntityFilter is Role , only the roles that are attached to the specified policy are returned. This parameter is optional. If it is not included, all attached entities (users, groups, and roles) are returned.

type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.

type Marker

string

param Marker

Use this only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.

type MaxItems

integer

param MaxItems

Use this only when paginating results to indicate the maximum number of entities you want in the response. If there are additional entities beyond the maximum you specify, the IsTruncated response element is true . This parameter is optional. If you do not include it, it defaults to 100.

rtype

dict

returns

Response Syntax

{
    'PolicyGroups': [
        {
            'GroupName': 'string'
        },
    ],
    'PolicyUsers': [
        {
            'UserName': 'string'
        },
    ],
    'PolicyRoles': [
        {
            'RoleName': 'string'
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a successful ListEntitiesForPolicy request.

    • PolicyGroups (list) --

      A list of groups that the policy is attached to.

      • (dict) --

        Contains information about a group that a managed policy is attached to.

        This data type is used as a response element in the ListEntitiesForPolicy action.

        For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

        • GroupName (string) --

          The name (friendly name, not ARN) identifying the group.

    • PolicyUsers (list) --

      A list of users that the policy is attached to.

      • (dict) --

        Contains information about a user that a managed policy is attached to.

        This data type is used as a response element in the ListEntitiesForPolicy action.

        For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

        • UserName (string) --

          The name (friendly name, not ARN) identifying the user.

    • PolicyRoles (list) --

      A list of roles that the policy is attached to.

      • (dict) --

        Contains information about a role that a managed policy is attached to.

        This data type is used as a response element in the ListEntitiesForPolicy action.

        For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

        • RoleName (string) --

          The name (friendly name, not ARN) identifying the role.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.

    • Marker (string) --

      If IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.