AWS Identity and Access Management

2014/10/16 - AWS Identity and Access Management - 76 new api methods

DeleteGroupPolicy (new) Link ¶

Deletes the specified policy that is associated with the specified group.

Request Syntax

client.delete_group_policy(
    GroupName='string',
    PolicyName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group the policy is associated with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to delete.

returns

None

ListInstanceProfiles (new) Link ¶

Lists the instance profiles that have the specified path prefix. If there are none, the action returns an empty list. For more information about instance profiles, go to About Instance Profiles.

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

Request Syntax

client.list_instance_profiles(
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. For example: /application_abc/component_xyz/ , which would get all instance profiles whose path starts with /application_abc/component_xyz/ .

This parameter is optional. If it is not included, it defaults to a slash (/), listing all instance profiles.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'InstanceProfiles': [
        {
            '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'
                },
            ]
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListInstanceProfiles action.

    • InstanceProfiles (list) --

      A list of instance profiles.

      • (dict) --

        The InstanceProfile data type 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) --

          Path to the instance profile. For more information about paths, see Identifiers for IAM Entities 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 Identifiers for IAM Entities 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 Identifiers for IAM Entities 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) --

            The Role data type contains information about a role.

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

            • CreateRole

            • GetRole

            • ListRoles

            • Path (string) --

              Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

            • RoleName (string) --

              The name identifying the role.

            • RoleId (string) --

              The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

            • CreateDate (datetime) --

              The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more instance profiles to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more instance profiles 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.

PutGroupPolicy (new) Link ¶

Adds (or updates) a policy document associated with the specified group. For information about policies, refer to Overview of Policies in the Using IAM guide.

For information about limits on the number of policies you can associate with a group, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.put_group_policy(
    GroupName='string',
    PolicyName='string',
    PolicyDocument='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group to associate the policy with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document.

type PolicyDocument

string

param PolicyDocument

[REQUIRED]

The policy document.

returns

None

DeleteSAMLProvider (new) Link ¶

Deletes a SAML provider.

Deleting the provider does not update any roles that reference the SAML provider as a principal in their trust policies. Any attempt to assume a role that references a SAML provider that has been deleted will fail.

Request Syntax

client.delete_saml_provider(
    SAMLProviderArn='string'
)
type SAMLProviderArn

string

param SAMLProviderArn

[REQUIRED]

The Amazon Resource Name (ARN) of the SAML provider to delete.

returns

None

ListServerCertificates (new) Link ¶

Lists the server certificates that have the specified path prefix. If none exist, the action returns an empty list.

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

Request Syntax

client.list_server_certificates(
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. For example: /company/servercerts would get all server certificates for which the path starts with /company/servercerts .

This parameter is optional. If it is not included, it defaults to a slash (/), listing all server certificates.

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 server certificates you want in the response. If there are additional server certificates beyond the maximum you specify, the IsTruncated response element will be set to true . This parameter is optional. If you do not include it, it defaults to 100.

rtype

dict

returns

Response Syntax

{
    'ServerCertificateMetadataList': [
        {
            'Path': 'string',
            'ServerCertificateName': 'string',
            'ServerCertificateId': 'string',
            'Arn': 'string',
            'UploadDate': datetime(2015, 1, 1),
            'Expiration': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListServerCertificates action.

    • ServerCertificateMetadataList (list) --

      A list of server certificates.

      • (dict) --

        ServerCertificateMetadata contains information about a server certificate without its certificate body, certificate chain, and private key.

        This data type is used as a response element in the action UploadServerCertificate and ListServerCertificates.

        • Path (string) --

          Path to the server certificate. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • ServerCertificateName (string) --

          The name that identifies the server certificate.

        • ServerCertificateId (string) --

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

        • Arn (string) --

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

        • UploadDate (datetime) --

          The date when the server certificate was uploaded.

        • Expiration (datetime) --

          The date on which the certificate is set to expire.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more server certificates to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more server certificates 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.

DeleteRolePolicy (new) Link ¶

Deletes the specified policy associated with the specified role.

Request Syntax

client.delete_role_policy(
    RoleName='string',
    PolicyName='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role the associated with the policy.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to delete.

returns

None

ListVirtualMFADevices (new) Link ¶

Lists the virtual MFA devices under the AWS account by assignment status. If you do not specify an assignment status, the action returns a list of all virtual MFA devices. Assignment status can be Assigned , Unassigned , or Any .

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

Request Syntax

client.list_virtual_mfa_devices(
    AssignmentStatus='Assigned'|'Unassigned'|'Any',
    Marker='string',
    MaxItems=123
)
type AssignmentStatus

string

param AssignmentStatus

The status (unassigned or assigned) of the devices to list. If you do not specify an AssignmentStatus , the action defaults to Any which lists both assigned and unassigned virtual MFA devices.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'VirtualMFADevices': [
        {
            'SerialNumber': 'string',
            'Base32StringSeed': b'bytes',
            'QRCodePNG': b'bytes',
            'User': {
                'Path': 'string',
                'UserName': 'string',
                'UserId': 'string',
                'Arn': 'string',
                'CreateDate': datetime(2015, 1, 1)
            },
            'EnableDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListVirtualMFADevices action.

    • VirtualMFADevices (list) --

      • (dict) --

        The VirtualMFADevice data type contains information about a virtual MFA device.

        • SerialNumber (string) --

          The serial number associated with VirtualMFADevice .

        • Base32StringSeed (bytes) --

          The Base32 seed defined as specified in RFC3548. The Base32StringSeed is Base64-encoded.

        • QRCodePNG (bytes) --

          A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName? secret=$Base32String where $virtualMFADeviceName is one of the create call arguments, AccountName is the user name if set (accountId otherwise), and Base32String is the seed in Base32 format. The Base32String is Base64-encoded.

        • User (dict) --

          The User data type contains information about a user.

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

          • CreateUser

          • GetUser

          • ListUsers

          • Path (string) --

            Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

          • UserName (string) --

            The name identifying the user.

          • UserId (string) --

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

          • Arn (string) --

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

          • CreateDate (datetime) --

            The date when the user was created.

        • EnableDate (datetime) --

    • IsTruncated (boolean) --

      A flag that indicates whether there are more items to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items 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.

CreateSAMLProvider (new) Link ¶

Creates an IAM entity to describe an identity provider (IdP) that supports SAML 2.0.

The SAML provider that you create with this operation can be used as a principal in a role's trust policy to establish a trust relationship between AWS and a SAML identity provider. You can create an IAM role that supports Web-based single sign-on (SSO) to the AWS Management Console or one that supports API access to AWS.

When you create the SAML provider, you upload an a SAML metadata document that you get from your IdP and that includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.

For more information, see Giving Console Access Using SAML and Creating Temporary Security Credentials for SAML Federation in the Using Temporary Credentials guide.

Request Syntax

client.create_saml_provider(
    SAMLMetadataDocument='string',
    Name='string'
)
type SAMLMetadataDocument

string

param SAMLMetadataDocument

[REQUIRED]

An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.

For more information, see Creating Temporary Security Credentials for SAML Federation in the Using Temporary Security Credentials guide.

type Name

string

param Name

[REQUIRED]

The name of the provider to create.

rtype

dict

returns

Response Syntax

{
    'SAMLProviderArn': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateSAMLProvider action.

    • SAMLProviderArn (string) --

      The Amazon Resource Name (ARN) of the SAML provider.

ListInstanceProfilesForRole (new) Link ¶

Lists the instance profiles that have the specified associated role. If there are none, the action returns an empty list. For more information about instance profiles, go to About Instance Profiles.

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

Request Syntax

client.list_instance_profiles_for_role(
    RoleName='string',
    Marker='string',
    MaxItems=123
)
type RoleName

string

param RoleName

[REQUIRED]

The name of the role to list instance profiles for.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'InstanceProfiles': [
        {
            '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'
                },
            ]
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListInstanceProfilesForRole action.

    • InstanceProfiles (list) --

      A list of instance profiles.

      • (dict) --

        The InstanceProfile data type 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) --

          Path to the instance profile. For more information about paths, see Identifiers for IAM Entities 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 Identifiers for IAM Entities 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 Identifiers for IAM Entities 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) --

            The Role data type contains information about a role.

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

            • CreateRole

            • GetRole

            • ListRoles

            • Path (string) --

              Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

            • RoleName (string) --

              The name identifying the role.

            • RoleId (string) --

              The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

            • CreateDate (datetime) --

              The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more instance profiles to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more instance profiles 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.

RemoveUserFromGroup (new) Link ¶

Removes the specified user from the specified group.

Request Syntax

client.remove_user_from_group(
    GroupName='string',
    UserName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group to update.

type UserName

string

param UserName

[REQUIRED]

Name of the user to remove.

returns

None

DeleteRole (new) Link ¶

Deletes the specified role. The role must not have any policies attached. For more information about roles, go to Working with Roles.

Warning

Make sure you do not have any Amazon EC2 instances running with the role you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

Request Syntax

client.delete_role(
    RoleName='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role to delete.

returns

None

ListSigningCertificates (new) Link ¶

Returns information about the signing certificates associated with the specified user. If there are none, the action returns an empty list.

Although each user is limited to a small number of signing certificates, you can still paginate the results using the MaxItems and Marker parameters.

If the UserName field is not specified, the user name is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if the AWS account has no associated users.

Request Syntax

client.list_signing_certificates(
    UserName='string',
    Marker='string',
    MaxItems=123
)
type UserName

string

param UserName

The name of the user.

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 certificate IDs you want in the response. If there are additional certificate IDs 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

{
    'Certificates': [
        {
            'UserName': 'string',
            'CertificateId': 'string',
            'CertificateBody': 'string',
            'Status': 'Active'|'Inactive',
            'UploadDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListSigningCertificates action.

    • Certificates (list) --

      A list of the user's signing certificate information.

      • (dict) --

        The SigningCertificate data type contains information about an X.509 signing certificate.

        This data type is used as a response element in the actions UploadSigningCertificate and ListSigningCertificates.

        • UserName (string) --

          Name of the user the signing certificate is associated with.

        • CertificateId (string) --

          The ID for the signing certificate.

        • CertificateBody (string) --

          The contents of the signing certificate.

        • Status (string) --

          The status of the signing certificate. Active means the key is valid for API calls, while Inactive means it is not.

        • UploadDate (datetime) --

          The date when the signing certificate was uploaded.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more certificate IDs to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more certificates 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.

ListAccessKeys (new) Link ¶

Returns information about the access key IDs associated with the specified user. If there are none, the action returns an empty list.

Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.

If the UserName field is not specified, the UserName is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if the AWS account has no associated users.

Request Syntax

client.list_access_keys(
    UserName='string',
    Marker='string',
    MaxItems=123
)
type UserName

string

param UserName

Name of the user.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of keys you want in the response. If there are additional keys 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

{
    'AccessKeyMetadata': [
        {
            'UserName': 'string',
            'AccessKeyId': 'string',
            'Status': 'Active'|'Inactive',
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListAccessKeys action.

    • AccessKeyMetadata (list) --

      A list of access key metadata.

      • (dict) --

        The AccessKey data type contains information about an AWS access key, without its secret key.

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

        • UserName (string) --

          Name of the user the key is associated with.

        • AccessKeyId (string) --

          The ID for this access key.

        • Status (string) --

          The status of the access key. Active means the key is valid for API calls, while Inactive means it is not.

        • CreateDate (datetime) --

          The date when the access key was created.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more keys to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more keys 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.

GetRole (new) Link ¶

Retrieves information about the specified role, including the role's path, GUID, ARN, and the policy granting permission to assume the role. For more information about ARNs, go to ARNs. For more information about roles, go to Working with Roles.

The returned policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.get_role(
    RoleName='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role to get information about.

rtype

dict

returns

Response Syntax

{
    'Role': {
        'Path': 'string',
        'RoleName': 'string',
        'RoleId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1),
        'AssumeRolePolicyDocument': 'string'
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetRole action.

    • Role (dict) --

      Information about the role.

      • Path (string) --

        Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • RoleName (string) --

        The name identifying the role.

      • RoleId (string) --

        The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

      • CreateDate (datetime) --

        The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

ListGroups (new) Link ¶

Lists the groups that have the specified path prefix.

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

Request Syntax

client.list_groups(
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/ , which would get all groups whose path starts with /division_abc/subdivision_xyz/ .

This parameter is optional. If it is not included, it defaults to a slash (/), listing all groups.

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 groups you want in the response. If there are additional groups 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

{
    'Groups': [
        {
            'Path': 'string',
            'GroupName': 'string',
            'GroupId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListGroups action.

    • Groups (list) --

      A list of groups.

      • (dict) --

        The Group data type contains information about a group.

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

        • CreateGroup

        • GetGroup

        • ListGroups

        • Path (string) --

          Path to the group. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • GroupName (string) --

          The name that identifies the group.

        • GroupId (string) --

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

        • Arn (string) --

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

        • CreateDate (datetime) --

          The date when the group was created.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more groups to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more groups 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.

CreateGroup (new) Link ¶

Creates a new group.

For information about the number of groups you can create, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.create_group(
    Path='string',
    GroupName='string'
)
type Path

string

param Path

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

This parameter is optional. If it is not included, it defaults to a slash (/).

type GroupName

string

param GroupName

[REQUIRED]

Name of the group to create. Do not include the path in this value.

rtype

dict

returns

Response Syntax

{
    'Group': {
        'Path': 'string',
        'GroupName': 'string',
        'GroupId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateGroup action.

    • Group (dict) --

      Information about the group.

      • Path (string) --

        Path to the group. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • GroupName (string) --

        The name that identifies the group.

      • GroupId (string) --

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

      • Arn (string) --

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

      • CreateDate (datetime) --

        The date when the group was created.

CreateAccountAlias (new) Link ¶

This action creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in the Using IAM guide.

Request Syntax

client.create_account_alias(
    AccountAlias='string'
)
type AccountAlias

string

param AccountAlias

[REQUIRED]

Name of the account alias to create.

returns

None

GetAccountSummary (new) Link ¶

Retrieves account level information about account entity usage and IAM quotas.

For information about limitations on IAM entities, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.get_account_summary()
rtype

dict

returns

Response Syntax

{
    'SummaryMap': {
        'string': 123
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetAccountSummary action.

    • SummaryMap (dict) --

      A set of key value pairs containing account-level information.

      SummaryMap contains the following keys:

      • AccessKeysPerUserQuota - Maximum number of access keys that can be created per user

      • AccountMFAEnabled - 1 if the root account has an MFA device assigned to it, 0 otherwise

      • AssumeRolePolicySizeQuota - Maximum allowed size for assume role policy documents (in kilobytes)

      • GroupPolicySizeQuota - Maximum allowed size for Group policy documents (in kilobytes)

      • Groups - Number of Groups for the AWS account

      • GroupsPerUserQuota - Maximum number of groups a user can belong to

      • GroupsQuota - Maximum groups allowed for the AWS account

      • InstanceProfiles - Number of instance profiles for the AWS account

      • InstanceProfilesQuota - Maximum instance profiles allowed for the AWS account

      • MFADevices - Number of MFA devices, either assigned or unassigned

      • MFADevicesInUse - Number of MFA devices that have been assigned to an IAM user or to the root account

      • RolePolicySizeQuota - Maximum allowed size for role policy documents (in kilobytes)

      • Roles - Number of roles for the AWS account

      • RolesQuota - Maximum roles allowed for the AWS account

      • ServerCertificates - Number of server certificates for the AWS account

      • ServerCertificatesQuota - Maximum server certificates allowed for the AWS account

      • SigningCertificatesPerUserQuota - Maximum number of X509 certificates allowed for a user

      • UserPolicySizeQuota - Maximum allowed size for user policy documents (in kilobytes)

      • Users - Number of users for the AWS account

      • UsersQuota - Maximum users allowed for the AWS account

      • (string) --

        • (integer) --

DeleteInstanceProfile (new) Link ¶

Deletes the specified instance profile. The instance profile must not have an associated role.

Warning

Make sure you do not have any Amazon EC2 instances running with the instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

For more information about instance profiles, go to About Instance Profiles.

Request Syntax

client.delete_instance_profile(
    InstanceProfileName='string'
)
type InstanceProfileName

string

param InstanceProfileName

[REQUIRED]

Name of the instance profile to delete.

returns

None

CreateAccessKey (new) Link ¶

Creates a new AWS secret access key and corresponding AWS access key ID for the specified user. The default status for new keys is Active .

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. Because this action works for access keys under the AWS account, you can use this API to manage root credentials even if the AWS account has no associated users.

For information about limits on the number of keys you can create, see Limitations on IAM Entities in the Using IAM guide.

Warning

To ensure the security of your AWS account, the secret access key is accessible only during key and user creation. You must save the key (for example, in a text file) if you want to be able to access it again. If a secret key is lost, you can delete the access keys for the associated user and then create new keys.

Request Syntax

client.create_access_key(
    UserName='string'
)
type UserName

string

param UserName

The user name that the new key will belong to.

rtype

dict

returns

Response Syntax

{
    'AccessKey': {
        'UserName': 'string',
        'AccessKeyId': 'string',
        'Status': 'Active'|'Inactive',
        'SecretAccessKey': 'string',
        'CreateDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateAccessKey action.

    • AccessKey (dict) --

      Information about the access key.

      • UserName (string) --

        Name of the user the key is associated with.

      • AccessKeyId (string) --

        The ID for this access key.

      • Status (string) --

        The status of the access key. Active means the key is valid for API calls, while Inactive means it is not.

      • SecretAccessKey (string) --

        The secret key used to sign requests.

      • CreateDate (datetime) --

        The date when the access key was created.

ChangePassword (new) Link ¶

Changes the password of the IAM user calling ChangePassword . The root account password is not affected by this action. For information about modifying passwords, see Managing Passwords in the Using IAM guide.

Request Syntax

client.change_password(
    OldPassword='string',
    NewPassword='string'
)
type OldPassword

string

param OldPassword

[REQUIRED]

The IAM users's current password.

type NewPassword

string

param NewPassword

[REQUIRED]

The new password. The new password must conform to the AWS account's password policy, if one exists.

returns

None

GenerateCredentialReport (new) Link ¶

Generates a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports in the Using IAM guide.

Request Syntax

client.generate_credential_report()
rtype

dict

returns

Response Syntax

{
    'State': 'STARTED'|'INPROGRESS'|'COMPLETE',
    'Description': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GenerateCredentialReport action.

    • State (string) --

      Information about the state of a credential report.

    • Description (string) --

      Information about the credential report.

GetGroup (new) Link ¶

Returns a list of users that are in the specified group. You can paginate the results using the MaxItems and Marker parameters.

Request Syntax

client.get_group(
    GroupName='string',
    Marker='string',
    MaxItems=123
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group.

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 user names you want in the response. If there are additional user names 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

{
    'Group': {
        'Path': 'string',
        'GroupName': 'string',
        'GroupId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1)
    },
    'Users': [
        {
            'Path': 'string',
            'UserName': 'string',
            'UserId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetGroup action.

    • Group (dict) --

      Information about the group.

      • Path (string) --

        Path to the group. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • GroupName (string) --

        The name that identifies the group.

      • GroupId (string) --

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

      • Arn (string) --

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

      • CreateDate (datetime) --

        The date when the group was created.

    • Users (list) --

      A list of users in the group.

      • (dict) --

        The User data type contains information about a user.

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

        • CreateUser

        • GetUser

        • ListUsers

        • Path (string) --

          Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • UserName (string) --

          The name identifying the user.

        • UserId (string) --

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

        • Arn (string) --

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

        • CreateDate (datetime) --

          The date when the user was created.

    • IsTruncated (boolean) --

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

    • Marker (string) --

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

UpdateServerCertificate (new) Link ¶

Updates the name and/or the path of the specified server certificate.

Warning

You should understand the implications of changing a server certificate's path or name. For more information, see Managing Server Certificates in the Using IAM guide.

Request Syntax

client.update_server_certificate(
    ServerCertificateName='string',
    NewPath='string',
    NewServerCertificateName='string'
)
type ServerCertificateName

string

param ServerCertificateName

[REQUIRED]

The name of the server certificate that you want to update.

type NewPath

string

param NewPath

The new path for the server certificate. Include this only if you are updating the server certificate's path.

type NewServerCertificateName

string

param NewServerCertificateName

The new name for the server certificate. Include this only if you are updating the server certificate's name.

returns

None

GetSAMLProvider (new) Link ¶

Returns the SAML provider metadocument that was uploaded when the provider was created or updated.

Request Syntax

client.get_saml_provider(
    SAMLProviderArn='string'
)
type SAMLProviderArn

string

param SAMLProviderArn

[REQUIRED]

The Amazon Resource Name (ARN) of the SAML provider to get information about.

rtype

dict

returns

Response Syntax

{
    'SAMLMetadataDocument': 'string',
    'CreateDate': datetime(2015, 1, 1),
    'ValidUntil': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetSAMLProvider action.

    • SAMLMetadataDocument (string) --

      The XML metadata document that includes information about an identity provider.

    • CreateDate (datetime) --

      The date and time when the SAML provider was created.

    • ValidUntil (datetime) --

      The expiration date and time for the SAML provider.

CreateLoginProfile (new) Link ¶

Creates a password for the specified user, giving the user the ability to access AWS services through the AWS Management Console. For more information about managing passwords, see Managing Passwords in the Using IAM guide.

Request Syntax

client.create_login_profile(
    UserName='string',
    Password='string',
    PasswordResetRequired=True|False
)
type UserName

string

param UserName

[REQUIRED]

Name of the user to create a password for.

type Password

string

param Password

[REQUIRED]

The new password for the user.

type PasswordResetRequired

boolean

param PasswordResetRequired

Specifies whether the user is required to set a new password on next sign-in.

rtype

dict

returns

Response Syntax

{
    'LoginProfile': {
        'UserName': 'string',
        'CreateDate': datetime(2015, 1, 1),
        'PasswordResetRequired': True|False
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateLoginProfile action.

    • LoginProfile (dict) --

      The user name and password create date.

      • UserName (string) --

        The name of the user, which can be used for signing in to the AWS Management Console.

      • CreateDate (datetime) --

        The date when the password for the user was created.

      • PasswordResetRequired (boolean) --

        Specifies whether the user is required to set a new password on next sign-in.

CreateInstanceProfile (new) Link ¶

Creates a new instance profile. For information about instance profiles, go to About Instance Profiles.

For information about the number of instance profiles you can create, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.create_instance_profile(
    InstanceProfileName='string',
    Path='string'
)
type InstanceProfileName

string

param InstanceProfileName

[REQUIRED]

Name of the instance profile to create.

type Path

string

param Path

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

This parameter is optional. If it is not included, it defaults to a slash (/).

rtype

dict

returns

Response Syntax

{
    'InstanceProfile': {
        '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'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateInstanceProfile action.

    • InstanceProfile (dict) --

      Information about the instance profile.

      • Path (string) --

        Path to the instance profile. For more information about paths, see Identifiers for IAM Entities 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 Identifiers for IAM Entities 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 Identifiers for IAM Entities 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) --

          The Role data type contains information about a role.

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

          • CreateRole

          • GetRole

          • ListRoles

          • Path (string) --

            Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

          • RoleName (string) --

            The name identifying the role.

          • RoleId (string) --

            The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

          • CreateDate (datetime) --

            The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

ListAccountAliases (new) Link ¶

Lists the account aliases associated with the account. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in the Using IAM guide.

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

Request Syntax

client.list_account_aliases(
    Marker='string',
    MaxItems=123
)
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 account aliases you want in the response. If there are additional account aliases 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

{
    'AccountAliases': [
        'string',
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListAccountAliases action.

    • AccountAliases (list) --

      A list of aliases associated with the account.

      • (string) --

    • IsTruncated (boolean) --

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

    • Marker (string) --

      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.

GetInstanceProfile (new) Link ¶

Retrieves information about the specified instance profile, including the instance profile's path, GUID, ARN, and role. For more information about instance profiles, go to About Instance Profiles. For more information about ARNs, go to ARNs.

Request Syntax

client.get_instance_profile(
    InstanceProfileName='string'
)
type InstanceProfileName

string

param InstanceProfileName

[REQUIRED]

Name of the instance profile to get information about.

rtype

dict

returns

Response Syntax

{
    'InstanceProfile': {
        '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'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetInstanceProfile action.

    • InstanceProfile (dict) --

      Information about the instance profile.

      • Path (string) --

        Path to the instance profile. For more information about paths, see Identifiers for IAM Entities 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 Identifiers for IAM Entities 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 Identifiers for IAM Entities 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) --

          The Role data type contains information about a role.

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

          • CreateRole

          • GetRole

          • ListRoles

          • Path (string) --

            Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

          • RoleName (string) --

            The name identifying the role.

          • RoleId (string) --

            The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

          • CreateDate (datetime) --

            The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

ListUserPolicies (new) Link ¶

Lists the names of the policies associated with the specified user. If there are none, the action returns an empty list.

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

Request Syntax

client.list_user_policies(
    UserName='string',
    Marker='string',
    MaxItems=123
)
type UserName

string

param UserName

[REQUIRED]

The name of the user to list policies for.

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 policy names you want in the response. If there are additional policy names 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

{
    'PolicyNames': [
        'string',
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListUserPolicies action.

    • PolicyNames (list) --

      A list of policy names.

      • (string) --

    • IsTruncated (boolean) --

      A flag that indicates whether there are more policy names to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more policy names 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.

UpdateGroup (new) Link ¶

Updates the name and/or the path of the specified group.

Warning

You should understand the implications of changing a group's path or name. For more information, see Renaming Users and Groups in the Using IAM guide.

Request Syntax

client.update_group(
    GroupName='string',
    NewPath='string',
    NewGroupName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group to update. If you're changing the name of the group, this is the original name.

type NewPath

string

param NewPath

New path for the group. Only include this if changing the group's path.

type NewGroupName

string

param NewGroupName

New name for the group. Only include this if changing the group's name.

returns

None

ListUsers (new) Link ¶

Lists the users that have the specified path prefix. If there are none, the action returns an empty list.

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

Request Syntax

client.list_users(
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/ , which would get all user names whose path starts with /division_abc/subdivision_xyz/ .

This parameter is optional. If it is not included, it defaults to a slash (/), listing all user names.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'Users': [
        {
            'Path': 'string',
            'UserName': 'string',
            'UserId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListUsers action.

    • Users (list) --

      A list of users.

      • (dict) --

        The User data type contains information about a user.

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

        • CreateUser

        • GetUser

        • ListUsers

        • Path (string) --

          Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • UserName (string) --

          The name identifying the user.

        • UserId (string) --

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

        • Arn (string) --

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

        • CreateDate (datetime) --

          The date when the user was created.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more user names to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more users 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.

UpdateAssumeRolePolicy (new) Link ¶

Updates the policy that grants an entity permission to assume a role. For more information about roles, go to Working with Roles.

Request Syntax

client.update_assume_role_policy(
    RoleName='string',
    PolicyDocument='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role to update.

type PolicyDocument

string

param PolicyDocument

[REQUIRED]

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

returns

None

UploadSigningCertificate (new) Link ¶

Uploads an X.509 signing certificate and associates it with the specified user. Some AWS services use X.509 signing certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is Active .

If the UserName field is not specified, the user name is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if the AWS account has no associated users.

Request Syntax

client.upload_signing_certificate(
    UserName='string',
    CertificateBody='string'
)
type UserName

string

param UserName

Name of the user the signing certificate is for.

type CertificateBody

string

param CertificateBody

[REQUIRED]

The contents of the signing certificate.

rtype

dict

returns

Response Syntax

{
    'Certificate': {
        'UserName': 'string',
        'CertificateId': 'string',
        'CertificateBody': 'string',
        'Status': 'Active'|'Inactive',
        'UploadDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the UploadSigningCertificate action.

    • Certificate (dict) --

      Information about the certificate.

      • UserName (string) --

        Name of the user the signing certificate is associated with.

      • CertificateId (string) --

        The ID for the signing certificate.

      • CertificateBody (string) --

        The contents of the signing certificate.

      • Status (string) --

        The status of the signing certificate. Active means the key is valid for API calls, while Inactive means it is not.

      • UploadDate (datetime) --

        The date when the signing certificate was uploaded.

PutUserPolicy (new) Link ¶

Adds (or updates) a policy document associated with the specified user. For information about policies, refer to Overview of Policies in the Using IAM guide.

For information about limits on the number of policies you can associate with a user, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.put_user_policy(
    UserName='string',
    PolicyName='string',
    PolicyDocument='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user to associate the policy with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document.

type PolicyDocument

string

param PolicyDocument

[REQUIRED]

The policy document.

returns

None

DeleteAccessKey (new) Link ¶

Deletes the access key associated with the specified user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. Because this action works for access keys under the AWS account, you can use this API to manage root credentials even if the AWS account has no associated users.

Request Syntax

client.delete_access_key(
    UserName='string',
    AccessKeyId='string'
)
type UserName

string

param UserName

Name of the user whose key you want to delete.

type AccessKeyId

string

param AccessKeyId

[REQUIRED]

The access key ID for the access key ID and secret access key you want to delete.

returns

None

CreateUser (new) Link ¶

Creates a new user for your AWS account.

For information about limitations on the number of users you can create, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.create_user(
    Path='string',
    UserName='string'
)
type Path

string

param Path

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

This parameter is optional. If it is not included, it defaults to a slash (/).

type UserName

string

param UserName

[REQUIRED]

Name of the user to create.

rtype

dict

returns

Response Syntax

{
    'User': {
        'Path': 'string',
        'UserName': 'string',
        'UserId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateUser action.

    • User (dict) --

      Information about the user.

      • Path (string) --

        Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • UserName (string) --

        The name identifying the user.

      • UserId (string) --

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

      • Arn (string) --

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

      • CreateDate (datetime) --

        The date when the user was created.

DeleteVirtualMFADevice (new) Link ¶

Deletes a virtual MFA device.

Request Syntax

client.delete_virtual_mfa_device(
    SerialNumber='string'
)
type SerialNumber

string

param SerialNumber

[REQUIRED]

The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the same as the ARN.

returns

None

GetServerCertificate (new) Link ¶

Retrieves information about the specified server certificate.

Request Syntax

client.get_server_certificate(
    ServerCertificateName='string'
)
type ServerCertificateName

string

param ServerCertificateName

[REQUIRED]

The name of the server certificate you want to retrieve information about.

rtype

dict

returns

Response Syntax

{
    'ServerCertificate': {
        'ServerCertificateMetadata': {
            'Path': 'string',
            'ServerCertificateName': 'string',
            'ServerCertificateId': 'string',
            'Arn': 'string',
            'UploadDate': datetime(2015, 1, 1),
            'Expiration': datetime(2015, 1, 1)
        },
        'CertificateBody': 'string',
        'CertificateChain': 'string'
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetServerCertificate action.

    • ServerCertificate (dict) --

      Information about the server certificate.

      • ServerCertificateMetadata (dict) --

        The meta information of the server certificate, such as its name, path, ID, and ARN.

        • Path (string) --

          Path to the server certificate. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • ServerCertificateName (string) --

          The name that identifies the server certificate.

        • ServerCertificateId (string) --

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

        • Arn (string) --

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

        • UploadDate (datetime) --

          The date when the server certificate was uploaded.

        • Expiration (datetime) --

          The date on which the certificate is set to expire.

      • CertificateBody (string) --

        The contents of the public key certificate.

      • CertificateChain (string) --

        The contents of the public key certificate chain.

GetUser (new) Link ¶

Retrieves information about the specified user, including the user's path, unique ID, and ARN.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request.

Request Syntax

client.get_user(
    UserName='string'
)
type UserName

string

param UserName

Name of the user to get information about.

This parameter is optional. If it is not included, it defaults to the user making the request.

rtype

dict

returns

Response Syntax

{
    'User': {
        'Path': 'string',
        'UserName': 'string',
        'UserId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetUser action.

    • User (dict) --

      Information about the user.

      • Path (string) --

        Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • UserName (string) --

        The name identifying the user.

      • UserId (string) --

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

      • Arn (string) --

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

      • CreateDate (datetime) --

        The date when the user was created.

GetUserPolicy (new) Link ¶

Retrieves the specified policy document for the specified user. The returned policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.get_user_policy(
    UserName='string',
    PolicyName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user who the policy is associated with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to get.

rtype

dict

returns

Response Syntax

{
    'UserName': 'string',
    'PolicyName': 'string',
    'PolicyDocument': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetUserPolicy action.

    • UserName (string) --

      The user the policy is associated with.

    • PolicyName (string) --

      The name of the policy.

    • PolicyDocument (string) --

      The policy document.

UpdateSAMLProvider (new) Link ¶

Updates the metadata document for an existing SAML provider.

Request Syntax

client.update_saml_provider(
    SAMLMetadataDocument='string',
    SAMLProviderArn='string'
)
type SAMLMetadataDocument

string

param SAMLMetadataDocument

[REQUIRED]

An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.

type SAMLProviderArn

string

param SAMLProviderArn

[REQUIRED]

The Amazon Resource Name (ARN) of the SAML provider to update.

rtype

dict

returns

Response Syntax

{
    'SAMLProviderArn': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the UpdateSAMLProvider action.

    • SAMLProviderArn (string) --

      The Amazon Resource Name (ARN) of the SAML provider that was updated.

UpdateAccountPasswordPolicy (new) Link ¶

Updates the password policy settings for the AWS account.

For more information about using a password policy, see Managing an IAM Password Policy in the Using IAM guide.

Request Syntax

client.update_account_password_policy(
    MinimumPasswordLength=123,
    RequireSymbols=True|False,
    RequireNumbers=True|False,
    RequireUppercaseCharacters=True|False,
    RequireLowercaseCharacters=True|False,
    AllowUsersToChangePassword=True|False,
    MaxPasswordAge=123,
    PasswordReusePrevention=123,
    HardExpiry=True|False
)
type MinimumPasswordLength

integer

param MinimumPasswordLength

The minimum number of characters allowed in an IAM user password.

Default value: 6

type RequireSymbols

boolean

param RequireSymbols

Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ' Default value: false

type RequireNumbers

boolean

param RequireNumbers

Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).

Default value: false

type RequireUppercaseCharacters

boolean

param RequireUppercaseCharacters

Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).

Default value: false

type RequireLowercaseCharacters

boolean

param RequireLowercaseCharacters

Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).

Default value: false

type AllowUsersToChangePassword

boolean

param AllowUsersToChangePassword

Allows all IAM users in your account to use the AWS Management Console to change their own passwords. For more information, see Letting IAM Users Change Their Own Passwords in the Using IAM guide.

Default value: false

type MaxPasswordAge

integer

param MaxPasswordAge

The number of days that an IAM user password is valid. The default value of 0 means IAM user passwords never expire.

Default value: 0

type PasswordReusePrevention

integer

param PasswordReusePrevention

Specifies the number of previous passwords that IAM users are prevented from reusing. The default value of 0 means IAM users are not prevented from reusing previous passwords.

Default value: 0

type HardExpiry

boolean

param HardExpiry

Prevents IAM users from setting a new password after their password has expired.

Default value: false

returns

None

DeleteAccountPasswordPolicy (new) Link ¶

Deletes the password policy for the AWS account.

Request Syntax

client.delete_account_password_policy()
returns

None

AddUserToGroup (new) Link ¶

Adds the specified user to the specified group.

Request Syntax

client.add_user_to_group(
    GroupName='string',
    UserName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group to update.

type UserName

string

param UserName

[REQUIRED]

Name of the user to add.

returns

None

GetCredentialReport (new) Link ¶

Retrieves a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports in the Using IAM guide.

Request Syntax

client.get_credential_report()
rtype

dict

returns

Response Syntax

{
    'Content': b'bytes',
    'ReportFormat': 'text/csv',
    'GeneratedTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetCredentialReport action.

    • Content (bytes) --

      Contains the credential report. The report is Base64-encoded.

    • ReportFormat (string) --

      The format (MIME type) of the credential report.

    • GeneratedTime (datetime) --

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

ListSAMLProviders (new) Link ¶

Lists the SAML providers in the account.

Request Syntax

client.list_saml_providers()
rtype

dict

returns

Response Syntax

{
    'SAMLProviderList': [
        {
            'Arn': 'string',
            'ValidUntil': datetime(2015, 1, 1),
            'CreateDate': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListSAMLProviders action.

    • SAMLProviderList (list) --

      The list of SAML providers for this account.

      • (dict) --

        The list of SAML providers for this account.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the SAML provider.

        • ValidUntil (datetime) --

          The expiration date and time for the SAML provider.

        • CreateDate (datetime) --

          The date and time when the SAML provider was created.

UpdateUser (new) Link ¶

Updates the name and/or the path of the specified user.

Warning

You should understand the implications of changing a user's path or name. For more information, see Renaming Users and Groups in the Using IAM guide.

Request Syntax

client.update_user(
    UserName='string',
    NewPath='string',
    NewUserName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user to update. If you're changing the name of the user, this is the original user name.

type NewPath

string

param NewPath

New path for the user. Include this parameter only if you're changing the user's path.

type NewUserName

string

param NewUserName

New name for the user. Include this parameter only if you're changing the user's name.

returns

None

UpdateAccessKey (new) Link ¶

Changes the status of the specified access key from Active to Inactive, or vice versa. This action can be used to disable a user's key as part of a key rotation work flow.

If the UserName field is not specified, the UserName is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if the AWS account has no associated users.

For information about rotating keys, see Managing Keys and Certificates in the Using IAM guide.

Request Syntax

client.update_access_key(
    UserName='string',
    AccessKeyId='string',
    Status='Active'|'Inactive'
)
type UserName

string

param UserName

Name of the user whose key you want to update.

type AccessKeyId

string

param AccessKeyId

[REQUIRED]

The access key ID of the secret access key you want to update.

type Status

string

param Status

[REQUIRED]

The status you want to assign to the secret access key. Active means the key can be used for API calls to AWS, while Inactive means the key cannot be used.

returns

None

UploadServerCertificate (new) Link ¶

Uploads a server certificate entity for the AWS account. The server certificate entity includes a public key certificate, a private key, and an optional certificate chain, which should all be PEM-encoded.

For information about the number of server certificates you can upload, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.upload_server_certificate(
    Path='string',
    ServerCertificateName='string',
    CertificateBody='string',
    PrivateKey='string',
    CertificateChain='string'
)
type Path

string

param Path

The path for the server certificate. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

This parameter is optional. If it is not included, it defaults to a slash (/).

type ServerCertificateName

string

param ServerCertificateName

[REQUIRED]

The name for the server certificate. Do not include the path in this value.

type CertificateBody

string

param CertificateBody

[REQUIRED]

The contents of the public key certificate in PEM-encoded format.

type PrivateKey

string

param PrivateKey

[REQUIRED]

The contents of the private key in PEM-encoded format.

type CertificateChain

string

param CertificateChain

The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.

rtype

dict

returns

Response Syntax

{
    'ServerCertificateMetadata': {
        'Path': 'string',
        'ServerCertificateName': 'string',
        'ServerCertificateId': 'string',
        'Arn': 'string',
        'UploadDate': datetime(2015, 1, 1),
        'Expiration': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the UploadServerCertificate action.

    • ServerCertificateMetadata (dict) --

      The meta information of the uploaded server certificate without its certificate body, certificate chain, and private key.

      • Path (string) --

        Path to the server certificate. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • ServerCertificateName (string) --

        The name that identifies the server certificate.

      • ServerCertificateId (string) --

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

      • Arn (string) --

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

      • UploadDate (datetime) --

        The date when the server certificate was uploaded.

      • Expiration (datetime) --

        The date on which the certificate is set to expire.

DeactivateMFADevice (new) Link ¶

Deactivates the specified MFA device and removes it from association with the user name for which it was originally enabled.

Request Syntax

client.deactivate_mfa_device(
    UserName='string',
    SerialNumber='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user whose MFA device you want to deactivate.

type SerialNumber

string

param SerialNumber

[REQUIRED]

The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.

returns

None

DeleteLoginProfile (new) Link ¶

Deletes the password for the specified user, which terminates the user's ability to access AWS services through the AWS Management Console.

Warning

Deleting a user's password does not prevent a user from accessing IAM through the command line interface or the API. To prevent all user access you must also either make the access key inactive or delete it. For more information about making keys inactive or deleting them, see UpdateAccessKey and DeleteAccessKey.

Request Syntax

client.delete_login_profile(
    UserName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user whose password you want to delete.

returns

None

EnableMFADevice (new) Link ¶

Enables the specified MFA device and associates it with the specified user name. When enabled, the MFA device is required for every subsequent login by the user name associated with the device.

Request Syntax

client.enable_mfa_device(
    UserName='string',
    SerialNumber='string',
    AuthenticationCode1='string',
    AuthenticationCode2='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user for whom you want to enable the MFA device.

type SerialNumber

string

param SerialNumber

[REQUIRED]

The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.

type AuthenticationCode1

string

param AuthenticationCode1

[REQUIRED]

An authentication code emitted by the device.

type AuthenticationCode2

string

param AuthenticationCode2

[REQUIRED]

A subsequent authentication code emitted by the device.

returns

None

ResyncMFADevice (new) Link ¶

Synchronizes the specified MFA device with AWS servers.

Request Syntax

client.resync_mfa_device(
    UserName='string',
    SerialNumber='string',
    AuthenticationCode1='string',
    AuthenticationCode2='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user whose MFA device you want to resynchronize.

type SerialNumber

string

param SerialNumber

[REQUIRED]

Serial number that uniquely identifies the MFA device.

type AuthenticationCode1

string

param AuthenticationCode1

[REQUIRED]

An authentication code emitted by the device.

type AuthenticationCode2

string

param AuthenticationCode2

[REQUIRED]

A subsequent authentication code emitted by the device.

returns

None

DeleteSigningCertificate (new) Link ¶

Deletes the specified signing certificate associated with the specified user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. Because this action works for access keys under the AWS account, you can use this API to manage root credentials even if the AWS account has no associated users.

Request Syntax

client.delete_signing_certificate(
    UserName='string',
    CertificateId='string'
)
type UserName

string

param UserName

Name of the user the signing certificate belongs to.

type CertificateId

string

param CertificateId

[REQUIRED]

ID of the signing certificate to delete.

returns

None

GetLoginProfile (new) Link ¶

Retrieves the user name and password-creation date for the specified user. If the user has not been assigned a password, the action returns a 404 ( NoSuchEntity ) error.

Request Syntax

client.get_login_profile(
    UserName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user whose login profile you want to retrieve.

rtype

dict

returns

Response Syntax

{
    'LoginProfile': {
        'UserName': 'string',
        'CreateDate': datetime(2015, 1, 1),
        'PasswordResetRequired': True|False
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetLoginProfile action.

    • LoginProfile (dict) --

      User name and password create date for the user.

      • UserName (string) --

        The name of the user, which can be used for signing in to the AWS Management Console.

      • CreateDate (datetime) --

        The date when the password for the user was created.

      • PasswordResetRequired (boolean) --

        Specifies whether the user is required to set a new password on next sign-in.

ListRolePolicies (new) Link ¶

Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list.

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

Request Syntax

client.list_role_policies(
    RoleName='string',
    Marker='string',
    MaxItems=123
)
type RoleName

string

param RoleName

[REQUIRED]

The name of the role to list policies for.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'PolicyNames': [
        'string',
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListRolePolicies action.

    • PolicyNames (list) --

      A list of policy names.

      • (string) --

    • IsTruncated (boolean) --

      A flag that indicates whether there are more policy names to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more policy names 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.

DeleteUser (new) Link ¶

Deletes the specified user. The user must not belong to any groups, have any keys or signing certificates, or have any attached policies.

Request Syntax

client.delete_user(
    UserName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user to delete.

returns

None

GetGroupPolicy (new) Link ¶

Retrieves the specified policy document for the specified group. The returned policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.get_group_policy(
    GroupName='string',
    PolicyName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group the policy is associated with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to get.

rtype

dict

returns

Response Syntax

{
    'GroupName': 'string',
    'PolicyName': 'string',
    'PolicyDocument': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetGroupPolicy action.

    • GroupName (string) --

      The group the policy is associated with.

    • PolicyName (string) --

      The name of the policy.

    • PolicyDocument (string) --

      The policy document.

DeleteServerCertificate (new) Link ¶

Deletes the specified server certificate.

Warning

If you are using a server certificate with Elastic Load Balancing, deleting the certificate could have implications for your application. If Elastic Load Balancing doesn't detect the deletion of bound certificates, it may continue to use the certificates. This could cause Elastic Load Balancing to stop accepting traffic. We recommend that you remove the reference to the certificate from Elastic Load Balancing before using this command to delete the certificate. For more information, go to DeleteLoadBalancerListeners in the Elastic Load Balancing API Reference .

Request Syntax

client.delete_server_certificate(
    ServerCertificateName='string'
)
type ServerCertificateName

string

param ServerCertificateName

[REQUIRED]

The name of the server certificate you want to delete.

returns

None

ListGroupPolicies (new) Link ¶

Lists the names of the policies associated with the specified group. If there are none, the action returns an empty list.

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

Request Syntax

client.list_group_policies(
    GroupName='string',
    Marker='string',
    MaxItems=123
)
type GroupName

string

param GroupName

[REQUIRED]

The name of the group to list policies for.

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 policy names you want in the response. If there are additional policy names 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

{
    'PolicyNames': [
        'string',
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListGroupPolicies action.

    • PolicyNames (list) --

      A list of policy names.

      • (string) --

    • IsTruncated (boolean) --

      A flag that indicates whether there are more policy names to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more policy names 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.

DeleteGroup (new) Link ¶

Deletes the specified group. The group must not contain any users or have any attached policies.

Request Syntax

client.delete_group(
    GroupName='string'
)
type GroupName

string

param GroupName

[REQUIRED]

Name of the group to delete.

returns

None

PutRolePolicy (new) Link ¶

Adds (or updates) a policy document associated with the specified role. For information about policies, go to Overview of Policies in the Using IAM guide.

For information about limits on the policies you can associate with a role, see Limitations on IAM Entities in the Using IAM guide.

Request Syntax

client.put_role_policy(
    RoleName='string',
    PolicyName='string',
    PolicyDocument='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role to associate the policy with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document.

type PolicyDocument

string

param PolicyDocument

[REQUIRED]

The policy document.

returns

None

DeleteUserPolicy (new) Link ¶

Deletes the specified policy associated with the specified user.

Request Syntax

client.delete_user_policy(
    UserName='string',
    PolicyName='string'
)
type UserName

string

param UserName

[REQUIRED]

Name of the user the policy is associated with.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to delete.

returns

None

ListMFADevices (new) Link ¶

Lists the MFA devices. If the request includes the user name, then this action lists all the MFA devices associated with the specified user name. If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request.

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

Request Syntax

client.list_mfa_devices(
    UserName='string',
    Marker='string',
    MaxItems=123
)
type UserName

string

param UserName

Name of the user whose MFA devices you want to list.

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 MFA devices you want in the response. If there are additional MFA devices 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

{
    'MFADevices': [
        {
            'UserName': 'string',
            'SerialNumber': 'string',
            'EnableDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListMFADevices action.

    • MFADevices (list) --

      A list of MFA devices.

      • (dict) --

        The MFADevice data type contains information about an MFA device.

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

        • UserName (string) --

          The user with whom the MFA device is associated.

        • SerialNumber (string) --

          The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.

        • EnableDate (datetime) --

          The date when the MFA device was enabled for the user.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more MFA devices to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more MFA devices 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.

RemoveRoleFromInstanceProfile (new) Link ¶

Removes the specified role from the specified instance profile.

Warning

Make sure you do not have any Amazon EC2 instances running with the role you are about to remove from the instance profile. Removing a role from an instance profile that is associated with a running instance will break any applications running on the instance.

For more information about roles, go to Working with Roles. For more information about instance profiles, go to About Instance Profiles.

Request Syntax

client.remove_role_from_instance_profile(
    InstanceProfileName='string',
    RoleName='string'
)
type InstanceProfileName

string

param InstanceProfileName

[REQUIRED]

Name of the instance profile to update.

type RoleName

string

param RoleName

[REQUIRED]

Name of the role to remove.

returns

None

CreateRole (new) Link ¶

Creates a new role for your AWS account. For more information about roles, go to Working with Roles. For information about limitations on role names and the number of roles you can create, go to Limitations on IAM Entities in the Using IAM guide.

The example policy grants permission to an EC2 instance to assume the role. The policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.create_role(
    Path='string',
    RoleName='string',
    AssumeRolePolicyDocument='string'
)
type Path

string

param Path

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

This parameter is optional. If it is not included, it defaults to a slash (/).

type RoleName

string

param RoleName

[REQUIRED]

Name of the role to create.

type AssumeRolePolicyDocument

string

param AssumeRolePolicyDocument

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'Role': {
        'Path': 'string',
        'RoleName': 'string',
        'RoleId': 'string',
        'Arn': 'string',
        'CreateDate': datetime(2015, 1, 1),
        'AssumeRolePolicyDocument': 'string'
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateRole action.

    • Role (dict) --

      Information about the role.

      • Path (string) --

        Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

      • RoleName (string) --

        The name identifying the role.

      • RoleId (string) --

        The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

      • CreateDate (datetime) --

        The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

UpdateSigningCertificate (new) Link ¶

Changes the status of the specified signing certificate from active to disabled, or vice versa. This action can be used to disable a user's signing certificate as part of a certificate rotation work flow.

If the UserName field is not specified, the UserName is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if the AWS account has no associated users.

For information about rotating certificates, see Managing Keys and Certificates in the Using IAM guide.

Request Syntax

client.update_signing_certificate(
    UserName='string',
    CertificateId='string',
    Status='Active'|'Inactive'
)
type UserName

string

param UserName

Name of the user the signing certificate belongs to.

type CertificateId

string

param CertificateId

[REQUIRED]

The ID of the signing certificate you want to update.

type Status

string

param Status

[REQUIRED]

The status you want to assign to the certificate. Active means the certificate can be used for API calls to AWS, while Inactive means the certificate cannot be used.

returns

None

DeleteAccountAlias (new) Link ¶

Deletes the specified AWS account alias. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in the Using IAM guide.

Request Syntax

client.delete_account_alias(
    AccountAlias='string'
)
type AccountAlias

string

param AccountAlias

[REQUIRED]

Name of the account alias to delete.

returns

None

CreateVirtualMFADevice (new) Link ¶

Creates a new virtual MFA device for the AWS account. After creating the virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device in the Using IAM guide.

For information about limits on the number of MFA devices you can create, see Limitations on Entities in the Using IAM guide.

Warning

The seed information contained in the QR code and the Base32 string should be treated like any other secret access information, such as your AWS access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.

Request Syntax

client.create_virtual_mfa_device(
    Path='string',
    VirtualMFADeviceName='string'
)
type Path

string

param Path

The path for the virtual MFA device. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

This parameter is optional. If it is not included, it defaults to a slash (/).

type VirtualMFADeviceName

string

param VirtualMFADeviceName

[REQUIRED]

The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.

rtype

dict

returns

Response Syntax

{
    'VirtualMFADevice': {
        'SerialNumber': 'string',
        'Base32StringSeed': b'bytes',
        'QRCodePNG': b'bytes',
        'User': {
            'Path': 'string',
            'UserName': 'string',
            'UserId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1)
        },
        'EnableDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the CreateVirtualMFADevice action.

    • VirtualMFADevice (dict) --

      A newly created virtual MFA device.

      • SerialNumber (string) --

        The serial number associated with VirtualMFADevice .

      • Base32StringSeed (bytes) --

        The Base32 seed defined as specified in RFC3548. The Base32StringSeed is Base64-encoded.

      • QRCodePNG (bytes) --

        A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName? secret=$Base32String where $virtualMFADeviceName is one of the create call arguments, AccountName is the user name if set (accountId otherwise), and Base32String is the seed in Base32 format. The Base32String is Base64-encoded.

      • User (dict) --

        The User data type contains information about a user.

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

        • CreateUser

        • GetUser

        • ListUsers

        • Path (string) --

          Path to the user. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • UserName (string) --

          The name identifying the user.

        • UserId (string) --

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

        • Arn (string) --

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

        • CreateDate (datetime) --

          The date when the user was created.

      • EnableDate (datetime) --

ListRoles (new) Link ¶

Lists the roles that have the specified path prefix. If there are none, the action returns an empty list. For more information about roles, go to Working with Roles.

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

The returned policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.list_roles(
    PathPrefix='string',
    Marker='string',
    MaxItems=123
)
type PathPrefix

string

param PathPrefix

The path prefix for filtering the results. For example: /application_abc/component_xyz/ , which would get all roles whose path starts with /application_abc/component_xyz/ .

This parameter is optional. If it is not included, it defaults to a slash (/), listing all roles.

type Marker

string

param Marker

Use this parameter 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 parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names 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

{
    'Roles': [
        {
            'Path': 'string',
            'RoleName': 'string',
            'RoleId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'AssumeRolePolicyDocument': 'string'
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListRoles action.

    • Roles (list) --

      A list of roles.

      • (dict) --

        The Role data type contains information about a role.

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

        • CreateRole

        • GetRole

        • ListRoles

        • Path (string) --

          Path to the role. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • RoleName (string) --

          The name identifying the role.

        • RoleId (string) --

          The stable and unique string identifying the role. For more information about IDs, see Identifiers for IAM Entities 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 Identifiers for IAM Entities in the Using IAM guide.

        • CreateDate (datetime) --

          The date 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. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more roles to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more roles 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.

ListGroupsForUser (new) Link ¶

Lists the groups the specified user belongs to.

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

Request Syntax

client.list_groups_for_user(
    UserName='string',
    Marker='string',
    MaxItems=123
)
type UserName

string

param UserName

[REQUIRED]

The name of the user to list groups for.

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 groups you want in the response. If there are additional groups 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

{
    'Groups': [
        {
            'Path': 'string',
            'GroupName': 'string',
            'GroupId': 'string',
            'Arn': 'string',
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'IsTruncated': True|False,
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the ListGroupsForUser action.

    • Groups (list) --

      A list of groups.

      • (dict) --

        The Group data type contains information about a group.

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

        • CreateGroup

        • GetGroup

        • ListGroups

        • Path (string) --

          Path to the group. For more information about paths, see Identifiers for IAM Entities in the Using IAM guide.

        • GroupName (string) --

          The name that identifies the group.

        • GroupId (string) --

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

        • Arn (string) --

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

        • CreateDate (datetime) --

          The date when the group was created.

    • IsTruncated (boolean) --

      A flag that indicates whether there are more groups to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more groups 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.

UpdateLoginProfile (new) Link ¶

Changes the password for the specified user.

Request Syntax

client.update_login_profile(
    UserName='string',
    Password='string',
    PasswordResetRequired=True|False
)
type UserName

string

param UserName

[REQUIRED]

Name of the user whose password you want to update.

type Password

string

param Password

The new password for the specified user.

type PasswordResetRequired

boolean

param PasswordResetRequired

Require the specified user to set a new password on next sign-in.

returns

None

AddRoleToInstanceProfile (new) Link ¶

Adds the specified role to the specified instance profile. For more information about roles, go to Working with Roles. For more information about instance profiles, go to About Instance Profiles.

Request Syntax

client.add_role_to_instance_profile(
    InstanceProfileName='string',
    RoleName='string'
)
type InstanceProfileName

string

param InstanceProfileName

[REQUIRED]

Name of the instance profile to update.

type RoleName

string

param RoleName

[REQUIRED]

Name of the role to add.

returns

None

GetRolePolicy (new) Link ¶

Retrieves the specified policy document for the specified role. For more information about roles, go to Working with Roles.

The returned policy is URL-encoded according to RFC 3986. For more information about RFC 3986, go to http://www.faqs.org/rfcs/rfc3986.html.

Request Syntax

client.get_role_policy(
    RoleName='string',
    PolicyName='string'
)
type RoleName

string

param RoleName

[REQUIRED]

Name of the role associated with the policy.

type PolicyName

string

param PolicyName

[REQUIRED]

Name of the policy document to get.

rtype

dict

returns

Response Syntax

{
    'RoleName': 'string',
    'PolicyName': 'string',
    'PolicyDocument': 'string'
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetRolePolicy action.

    • RoleName (string) --

      The role the policy is associated with.

    • PolicyName (string) --

      The name of the policy.

    • PolicyDocument (string) --

      The policy document.

GetAccountPasswordPolicy (new) Link ¶

Retrieves the password policy for the AWS account. For more information about using a password policy, go to Managing an IAM Password Policy.

Request Syntax

client.get_account_password_policy()
rtype

dict

returns

Response Syntax

{
    'PasswordPolicy': {
        'MinimumPasswordLength': 123,
        'RequireSymbols': True|False,
        'RequireNumbers': True|False,
        'RequireUppercaseCharacters': True|False,
        'RequireLowercaseCharacters': True|False,
        'AllowUsersToChangePassword': True|False,
        'ExpirePasswords': True|False,
        'MaxPasswordAge': 123,
        'PasswordReusePrevention': 123,
        'HardExpiry': True|False
    }
}

Response Structure

  • (dict) --

    Contains the result of a successful invocation of the GetAccountPasswordPolicy action.

    • PasswordPolicy (dict) --

      The PasswordPolicy data type contains information about the account password policy.

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

      • MinimumPasswordLength (integer) --

        Minimum length to require for IAM user passwords.

      • RequireSymbols (boolean) --

        Specifies whether to require symbols for IAM user passwords.

      • RequireNumbers (boolean) --

        Specifies whether to require numbers for IAM user passwords.

      • RequireUppercaseCharacters (boolean) --

        Specifies whether to require uppercase characters for IAM user passwords.

      • RequireLowercaseCharacters (boolean) --

        Specifies whether to require lowercase characters for IAM user passwords.

      • AllowUsersToChangePassword (boolean) --

        Specifies whether IAM users are allowed to change their own password.

      • ExpirePasswords (boolean) --

        Specifies whether IAM users are required to change their password after a specified number of days.

      • MaxPasswordAge (integer) --

        The number of days that an IAM user password is valid.

      • PasswordReusePrevention (integer) --

        Specifies the number of previous passwords that IAM users are prevented from reusing.

      • HardExpiry (boolean) --

        Specifies whether IAM users are prevented from setting a new password after their password has expired.