Table of Contents
IAM.Client¶A low-level client representing AWS Identity and Access Management (IAM):
client = session.create_client('iam')
These are the available methods:
add_client_id_to_open_id_connect_provider()add_role_to_instance_profile()add_user_to_group()attach_group_policy()attach_role_policy()attach_user_policy()can_paginate()change_password()create_access_key()create_account_alias()create_group()create_instance_profile()create_login_profile()create_open_id_connect_provider()create_policy()create_policy_version()create_role()create_saml_provider()create_service_linked_role()create_service_specific_credential()create_user()create_virtual_mfa_device()deactivate_mfa_device()delete_access_key()delete_account_alias()delete_account_password_policy()delete_group()delete_group_policy()delete_instance_profile()delete_login_profile()delete_open_id_connect_provider()delete_policy()delete_policy_version()delete_role()delete_role_policy()delete_saml_provider()delete_server_certificate()delete_service_specific_credential()delete_signing_certificate()delete_ssh_public_key()delete_user()delete_user_policy()delete_virtual_mfa_device()detach_group_policy()detach_role_policy()detach_user_policy()enable_mfa_device()generate_credential_report()generate_presigned_url()get_access_key_last_used()get_account_authorization_details()get_account_password_policy()get_account_summary()get_context_keys_for_custom_policy()get_context_keys_for_principal_policy()get_credential_report()get_group()get_group_policy()get_instance_profile()get_login_profile()get_open_id_connect_provider()get_paginator()get_policy()get_policy_version()get_role()get_role_policy()get_saml_provider()get_server_certificate()get_ssh_public_key()get_user()get_user_policy()get_waiter()list_access_keys()list_account_aliases()list_attached_group_policies()list_attached_role_policies()list_attached_user_policies()list_entities_for_policy()list_group_policies()list_groups()list_groups_for_user()list_instance_profiles()list_instance_profiles_for_role()list_mfa_devices()list_open_id_connect_providers()list_policies()list_policy_versions()list_role_policies()list_roles()list_saml_providers()list_server_certificates()list_service_specific_credentials()list_signing_certificates()list_ssh_public_keys()list_user_policies()list_users()list_virtual_mfa_devices()put_group_policy()put_role_policy()put_user_policy()remove_client_id_from_open_id_connect_provider()remove_role_from_instance_profile()remove_user_from_group()reset_service_specific_credential()resync_mfa_device()set_default_policy_version()simulate_custom_policy()simulate_principal_policy()update_access_key()update_account_password_policy()update_assume_role_policy()update_group()update_login_profile()update_open_id_connect_provider_thumbprint()update_role_description()update_saml_provider()update_server_certificate()update_service_specific_credential()update_signing_certificate()update_ssh_public_key()update_user()upload_server_certificate()upload_signing_certificate()upload_ssh_public_key()add_client_id_to_open_id_connect_provider(**kwargs)¶Adds a new client ID (also known as audience) to the list of client IDs already registered for the specified IAM OpenID Connect (OIDC) provider resource.
This action is idempotent; it does not fail or return an error if you add an existing client ID to the provider.
See also: AWS API Documentation
Request Syntax
response = client.add_client_id_to_open_id_connect_provider(
OpenIDConnectProviderArn='string',
ClientID='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following add-client-id-to-open-id-connect-provider command adds the client ID my-application-ID to the OIDC provider named server.example.com:
response = client.add_client_id_to_open_id_connect_provider(
ClientID='my-application-ID',
OpenIDConnectProviderArn='arn:aws:iam::123456789012:oidc-provider/server.example.com',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
add_role_to_instance_profile(**kwargs)¶Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role, and this limit cannot be increased.
Note
The caller of this API must be granted the PassRole permission on the IAM role by a permission policy.
For more information about roles, go to Working with Roles . For more information about instance profiles, go to About Instance Profiles .
See also: AWS API Documentation
Request Syntax
response = client.add_role_to_instance_profile(
InstanceProfileName='string',
RoleName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command adds the role named S3Access to the instance profile named Webserver:
response = client.add_role_to_instance_profile(
InstanceProfileName='Webserver',
RoleName='S3Access',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
add_user_to_group(**kwargs)¶Adds the specified user to the specified group.
See also: AWS API Documentation
Request Syntax
response = client.add_user_to_group(
GroupName='string',
UserName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command adds an IAM user named Bob to the IAM group named Admins:
response = client.add_user_to_group(
GroupName='Admins',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
attach_group_policy(**kwargs)¶Attaches the specified managed policy to the specified IAM group.
You use this API to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy .
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_group_policy(
GroupName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command attaches the AWS managed policy named ReadOnlyAccess to the IAM group named Finance.
response = client.attach_group_policy(
GroupName='Finance',
PolicyArn='arn:aws:iam::aws:policy/ReadOnlyAccess',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
attach_role_policy(**kwargs)¶Attaches the specified managed policy to the specified IAM role. When you attach a managed policy to a role, the managed policy becomes part of the role’s permission (access) policy.
Note
You cannot use a managed policy as the role’s trust policy. The role’s trust policy is created at the same time as the role, using CreateRole . You can update a role’s trust policy using UpdateAssumeRolePolicy .
Use this API to attach a managed policy to a role. To embed an inline policy in a role, use PutRolePolicy . For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_role_policy(
RoleName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command attaches the AWS managed policy named ReadOnlyAccess to the IAM role named ReadOnlyRole.
response = client.attach_role_policy(
PolicyArn='arn:aws:iam::aws:policy/ReadOnlyAccess',
RoleName='ReadOnlyRole',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
attach_user_policy(**kwargs)¶Attaches the specified managed policy to the specified user.
You use this API to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy .
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_user_policy(
UserName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command attaches the AWS managed policy named AdministratorAccess to the IAM user named Alice.
response = client.attach_user_policy(
PolicyArn='arn:aws:iam::aws:policy/AdministratorAccess',
UserName='Alice',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
change_password(**kwargs)¶Changes the password of the IAM user who is calling this action. The root account password is not affected by this action.
To change the password for a different user, see UpdateLoginProfile . For more information about modifying passwords, see Managing Passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.change_password(
OldPassword='string',
NewPassword='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command changes the password for the current IAM user.
response = client.change_password(
NewPassword=']35d/{pB9Fo9wJ',
OldPassword='3s0K_;xh4~8XXI',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_access_key(**kwargs)¶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 action 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 IAM User 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.
See also: AWS API Documentation
Request Syntax
response = client.create_access_key(
UserName='string'
)
| Parameters: | UserName (string) – The name of the IAM user that the new key will belong to. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'AccessKey': {
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'SecretAccessKey': 'string',
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following command creates an access key (access key ID and secret access key) for the IAM user named Bob.
response = client.create_access_key(
UserName='Bob',
)
print(response)
Expected Output:
{
'AccessKey': {
'AccessKeyId': 'AKIAIOSFODNN7EXAMPLE',
'CreateDate': datetime(2015, 3, 9, 18, 39, 23, 0, 68, 0),
'SecretAccessKey': 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY',
'Status': 'Active',
'UserName': 'Bob',
},
'ResponseMetadata': {
'...': '...',
},
}
create_account_alias(**kwargs)¶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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_account_alias(
AccountAlias='string'
)
| Parameters: | AccountAlias (string) – [REQUIRED] The account alias to create. This parameter allows (per its regex pattern ) a string of characters consisting of lowercase letters, digits, and dashes. You cannot start or finish with a dash, nor can you have two dashes in a row. |
|---|---|
| Returns: | None |
Examples
The following command associates the alias examplecorp to your AWS account.
response = client.create_account_alias(
AccountAlias='examplecorp',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_group(**kwargs)¶Creates a new group.
For information about the number of groups you can create, see Limitations on IAM Entities in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_group(
Path='string',
GroupName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Group': {
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following command creates an IAM group named Admins.
response = client.create_group(
GroupName='Admins',
)
print(response)
Expected Output:
{
'Group': {
'Arn': 'arn:aws:iam::123456789012:group/Admins',
'CreateDate': datetime(2015, 3, 9, 20, 30, 24, 0, 68, 0),
'GroupId': 'AIDGPMS9RO4H3FEXAMPLE',
'GroupName': 'Admins',
'Path': '/',
},
'ResponseMetadata': {
'...': '...',
},
}
create_instance_profile(**kwargs)¶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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_instance_profile(
InstanceProfileName='string',
Path='string'
)
| Parameters: |
|
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
}
}
Response Structure
|
Examples
The following command creates an instance profile named Webserver that is ready to have a role attached and then be associated with an EC2 instance.
response = client.create_instance_profile(
InstanceProfileName='Webserver',
)
print(response)
Expected Output:
{
'InstanceProfile': {
'Arn': 'arn:aws:iam::123456789012:instance-profile/Webserver',
'CreateDate': datetime(2015, 3, 9, 20, 33, 19, 0, 68, 0),
'InstanceProfileId': 'AIPAJMBYC7DLSPEXAMPLE',
'InstanceProfileName': 'Webserver',
'Path': '/',
'Roles': [
],
},
'ResponseMetadata': {
'...': '...',
},
}
create_login_profile(**kwargs)¶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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_login_profile(
UserName='string',
Password='string',
PasswordResetRequired=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LoginProfile': {
'UserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordResetRequired': True|False
}
}
Response Structure
|
Examples
The following command changes IAM user Bob’s password and sets the flag that required Bob to change the password the next time he signs in.
response = client.create_login_profile(
Password='h]6EszR}vJ*m',
PasswordResetRequired=True,
UserName='Bob',
)
print(response)
Expected Output:
{
'LoginProfile': {
'CreateDate': datetime(2015, 3, 10, 20, 55, 40, 1, 69, 0),
'PasswordResetRequired': True,
'UserName': 'Bob',
},
'ResponseMetadata': {
'...': '...',
},
}
create_open_id_connect_provider(**kwargs)¶Creates an IAM entity to describe an identity provider (IdP) that supports OpenID Connect (OIDC) .
The OIDC 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 the OIDC provider.
When you create the IAM OIDC provider, you specify the URL of the OIDC identity provider (IdP) to trust, a list of client IDs (also known as audiences) that identify the application or applications that are allowed to authenticate using the OIDC provider, and a list of thumbprints of the server certificate(s) that the IdP uses. You get all of this information from the OIDC IdP that you want to use for access to AWS.
Note
Because trust for the OIDC provider is ultimately derived from the IAM provider that this action creates, it is a best practice to limit access to the CreateOpenIDConnectProvider action to highly-privileged users.
See also: AWS API Documentation
Request Syntax
response = client.create_open_id_connect_provider(
Url='string',
ClientIDList=[
'string',
],
ThumbprintList=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'OpenIDConnectProviderArn': 'string'
}
Response Structure
|
Examples
The following example defines a new OIDC provider in IAM with a client ID of my-application-id and pointing at the server with a URL of https://server.example.com.
response = client.create_open_id_connect_provider(
ClientIDList=[
'my-application-id',
],
ThumbprintList=[
'3768084dfb3d2b68b7897bf5f565da8efEXAMPLE',
],
Url='https://server.example.com',
)
print(response)
Expected Output:
{
'OpenIDConnectProviderArn': 'arn:aws:iam::123456789012:oidc-provider/server.example.com',
'ResponseMetadata': {
'...': '...',
},
}
create_policy(**kwargs)¶Creates a new managed policy for your AWS account.
This operation creates a policy version with a version identifier of v1 and sets v1 as the policy’s default version. For more information about policy versions, see Versioning for Managed Policies in the IAM User Guide .
For more information about managed policies in general, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_policy(
PolicyName='string',
Path='string',
PolicyDocument='string',
Description='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Policy': {
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
create_policy_version(**kwargs)¶Creates a new version of the specified managed policy. To update a managed policy, you create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must delete an existing version using DeletePolicyVersion before you create a new version.
Optionally, you can set the new version as the policy’s default version. The default version is the version that is in effect for the IAM users, groups, and roles to which the policy is attached.
For more information about managed policy versions, see Versioning for Managed Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_policy_version(
PolicyArn='string',
PolicyDocument='string',
SetAsDefault=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyVersion': {
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
create_role(**kwargs)¶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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_role(
Path='string',
RoleName='string',
AssumeRolePolicyDocument='string',
Description='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
}
}
Response Structure
|
Examples
The following command creates a role named Test-Role and attaches a trust policy to it that is provided as a URL-encoded JSON string.
response = client.create_role(
AssumeRolePolicyDocument='<URL-encoded-JSON>',
Path='/',
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'Role': {
'Arn': 'arn:aws:iam::123456789012:role/Test-Role',
'AssumeRolePolicyDocument': '<URL-encoded-JSON>',
'CreateDate': datetime(2013, 6, 7, 20, 43, 32, 4, 158, 0),
'Path': '/',
'RoleId': 'AKIAIOSFODNN7EXAMPLE',
'RoleName': 'Test-Role',
},
'ResponseMetadata': {
'...': '...',
},
}
create_saml_provider(**kwargs)¶Creates an IAM resource that describes an identity provider (IdP) that supports SAML 2.0.
The SAML provider resource that you create with this operation can be used as a principal in an IAM role’s trust policy to enable federated users who sign-in using the SAML IdP to assume the role. 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 resource, 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 the IdP sends. You must generate the metadata document using the identity management software that is used as your organization’s IdP.
Note
This operation requires Signature Version 4 .
For more information, see Enabling SAML 2.0 Federated Users to Access the AWS Management Console and About SAML 2.0-based Federation in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_saml_provider(
SAMLMetadataDocument='string',
Name='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SAMLProviderArn': 'string'
}
Response Structure
|
create_service_linked_role(**kwargs)¶Creates an IAM role that is linked to a specific AWS service. The service controls the attached policies and when the role can be deleted. This helps ensure that the service is not broken by an unexpectedly changed or deleted role, which could put your AWS resources into an unknown state. Allowing the service to control the role helps improve service stability and proper cleanup when a service and its role are no longer needed.
The name of the role is autogenerated by combining the string that you specify for the AWSServiceName parameter with the string that you specify for the CustomSuffix parameter. The resulting name must be unique in your account or the request fails.
To attach a policy to this service-linked role, you must make the request using the AWS service that depends on this role.
See also: AWS API Documentation
Request Syntax
response = client.create_service_linked_role(
AWSServiceName='string',
Description='string',
CustomSuffix='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
}
}
Response Structure
|
create_service_specific_credential(**kwargs)¶Generates a set of credentials consisting of a user name and password that can be used to access the service specified in the request. These credentials are generated by IAM, and can be used only for the specified service.
You can have a maximum of two sets of service-specific credentials for each supported service per user.
The only supported service at this time is AWS CodeCommit.
You can reset the password to a new service-generated value by calling ResetServiceSpecificCredential .
For more information about service-specific credentials, see Using IAM with AWS CodeCommit: Git Credentials, SSH Keys, and AWS Access Keys in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_service_specific_credential(
UserName='string',
ServiceName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ServiceSpecificCredential': {
'CreateDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'ServiceUserName': 'string',
'ServicePassword': 'string',
'ServiceSpecificCredentialId': 'string',
'UserName': 'string',
'Status': 'Active'|'Inactive'
}
}
Response Structure
|
create_user(**kwargs)¶Creates a new IAM user for your AWS account.
For information about limitations on the number of IAM users you can create, see Limitations on IAM Entities in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_user(
Path='string',
UserName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'User': {
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following create-user command creates an IAM user named Bob in the current account.
response = client.create_user(
UserName='Bob',
)
print(response)
Expected Output:
{
'User': {
'Arn': 'arn:aws:iam::123456789012:user/Bob',
'CreateDate': datetime(2013, 6, 8, 3, 20, 41, 5, 159, 0),
'Path': '/',
'UserId': 'AKIAIOSFODNN7EXAMPLE',
'UserName': 'Bob',
},
'ResponseMetadata': {
'...': '...',
},
}
create_virtual_mfa_device(**kwargs)¶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 IAM User Guide .
For information about limits on the number of MFA devices you can create, see Limitations on Entities in the IAM User 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.
See also: AWS API Documentation
Request Syntax
response = client.create_virtual_mfa_device(
Path='string',
VirtualMFADeviceName='string'
)
| Parameters: |
|
|---|---|
| Return type: | 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),
'PasswordLastUsed': datetime(2015, 1, 1)
},
'EnableDate': datetime(2015, 1, 1)
}
}
Response Structure
|
deactivate_mfa_device(**kwargs)¶Deactivates the specified MFA device and removes it from association with the user name for which it was originally enabled.
For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.deactivate_mfa_device(
UserName='string',
SerialNumber='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_access_key(**kwargs)¶Deletes the access key pair associated with the specified IAM 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 action to manage root credentials even if the AWS account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.delete_access_key(
UserName='string',
AccessKeyId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command deletes one access key (access key ID and secret access key) assigned to the IAM user named Bob.
response = client.delete_access_key(
AccessKeyId='AKIDPMS9RO4H3FEXAMPLE',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_account_alias(**kwargs)¶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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_account_alias(
AccountAlias='string'
)
| Parameters: | AccountAlias (string) – [REQUIRED] The name of the account alias to delete. This parameter allows (per its regex pattern ) a string of characters consisting of lowercase letters, digits, and dashes. You cannot start or finish with a dash, nor can you have two dashes in a row. |
|---|---|
| Returns: | None |
Examples
The following command removes the alias mycompany from the current AWS account:
response = client.delete_account_alias(
AccountAlias='mycompany',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_account_password_policy()¶Deletes the password policy for the AWS account. There are no parameters.
See also: AWS API Documentation
Request Syntax
response = client.delete_account_password_policy()
| Returns: | None |
|---|
Examples
The following command removes the password policy from the current AWS account:
response = client.delete_account_password_policy(
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_group(**kwargs)¶Deletes the specified IAM group. The group must not contain any users or have any attached policies.
See also: AWS API Documentation
Request Syntax
response = client.delete_group(
GroupName='string'
)
| Parameters: | GroupName (string) – [REQUIRED] The name of the IAM group to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
delete_group_policy(**kwargs)¶Deletes the specified inline policy that is embedded in the specified IAM group.
A group can also have managed policies attached to it. To detach a managed policy from a group, use DetachGroupPolicy . For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_group_policy(
GroupName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command deletes the policy named ExamplePolicy from the group named Admins:
response = client.delete_group_policy(
GroupName='Admins',
PolicyName='ExamplePolicy',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_instance_profile(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.delete_instance_profile(
InstanceProfileName='string'
)
| Parameters: | InstanceProfileName (string) – [REQUIRED] The name of the instance profile to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
Examples
The following command deletes the instance profile named ExampleInstanceProfile
response = client.delete_instance_profile(
InstanceProfileName='ExampleInstanceProfile',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_login_profile(**kwargs)¶Deletes the password for the specified IAM 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 AWS through the command line interface or the API. To prevent all user access you must also either make any access keys inactive or delete them. For more information about making keys inactive or deleting them, see UpdateAccessKey and DeleteAccessKey .
See also: AWS API Documentation
Request Syntax
response = client.delete_login_profile(
UserName='string'
)
| Parameters: | UserName (string) – [REQUIRED] The name of the user whose password you want to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
Examples
The following command deletes the password for the IAM user named Bob.
response = client.delete_login_profile(
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_open_id_connect_provider(**kwargs)¶Deletes an OpenID Connect identity provider (IdP) resource object in IAM.
Deleting an IAM OIDC provider resource does not update any roles that reference the provider as a principal in their trust policies. Any attempt to assume a role that references a deleted provider fails.
This action is idempotent; it does not fail or return an error if you call the action for a provider that does not exist.
See also: AWS API Documentation
Request Syntax
response = client.delete_open_id_connect_provider(
OpenIDConnectProviderArn='string'
)
| Parameters: | OpenIDConnectProviderArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the IAM OpenID Connect provider resource object to delete. You can get a list of OpenID Connect provider resource ARNs by using the ListOpenIDConnectProviders action. |
|---|---|
| Returns: | None |
delete_policy(**kwargs)¶Deletes the specified managed policy.
Before you can delete a managed policy, you must first detach the policy from all users, groups, and roles that it is attached to, and you must delete all of the policy’s versions. The following steps describe the process for deleting a managed policy:
For information about managed policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_policy(
PolicyArn='string'
)
| Parameters: | PolicyArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the IAM policy you want to delete. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference . |
|---|---|
| Returns: | None |
delete_policy_version(**kwargs)¶Deletes the specified version from the specified managed policy.
You cannot delete the default version from a policy using this API. To delete the default version from a policy, use DeletePolicy . To find out which version of a policy is marked as the default version, use ListPolicyVersions .
For information about versions for managed policies, see Versioning for Managed Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_policy_version(
PolicyArn='string',
VersionId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_role(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_role(
RoleName='string'
)
| Parameters: | RoleName (string) – [REQUIRED] The name of the role to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@- |
|---|---|
| Returns: | None |
Examples
The following command removes the role named Test-Role.
response = client.delete_role(
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_role_policy(**kwargs)¶Deletes the specified inline policy that is embedded in the specified IAM role.
A role can also have managed policies attached to it. To detach a managed policy from a role, use DetachRolePolicy . For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_role_policy(
RoleName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command removes the policy named ExamplePolicy from the role named Test-Role.
response = client.delete_role_policy(
PolicyName='ExamplePolicy',
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_saml_provider(**kwargs)¶Deletes a SAML provider resource in IAM.
Deleting the provider resource from IAM does not update any roles that reference the SAML provider resource’s ARN as a principal in their trust policies. Any attempt to assume a role that references a non-existent provider resource ARN fails.
Note
This operation requires Signature Version 4 .
See also: AWS API Documentation
Request Syntax
response = client.delete_saml_provider(
SAMLProviderArn='string'
)
| Parameters: | SAMLProviderArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the SAML provider to delete. |
|---|---|
| Returns: | None |
delete_server_certificate(**kwargs)¶Deletes the specified server certificate.
For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide .
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 .
See also: AWS API Documentation
Request Syntax
response = client.delete_server_certificate(
ServerCertificateName='string'
)
| Parameters: | ServerCertificateName (string) – [REQUIRED] The name of the server certificate you want to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
delete_service_specific_credential(**kwargs)¶Deletes the specified service-specific credential.
See also: AWS API Documentation
Request Syntax
response = client.delete_service_specific_credential(
UserName='string',
ServiceSpecificCredentialId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_signing_certificate(**kwargs)¶Deletes a signing certificate associated with the specified IAM 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 action to manage root credentials even if the AWS account has no associated IAM users.
See also: AWS API Documentation
Request Syntax
response = client.delete_signing_certificate(
UserName='string',
CertificateId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command deletes the specified signing certificate for the IAM user named Anika.
response = client.delete_signing_certificate(
CertificateId='TA7SMP42TDN5Z26OBPJE7EXAMPLE',
UserName='Anika',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_ssh_public_key(**kwargs)¶Deletes the specified SSH public key.
The SSH public key deleted by this action is used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections in the AWS CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_ssh_public_key(
UserName='string',
SSHPublicKeyId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_user(**kwargs)¶Deletes the specified IAM user. The user must not belong to any groups or have any access keys, signing certificates, or attached policies.
See also: AWS API Documentation
Request Syntax
response = client.delete_user(
UserName='string'
)
| Parameters: | UserName (string) – [REQUIRED] The name of the user to delete. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
Examples
The following command removes the IAM user named Bob from the current account.
response = client.delete_user(
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_user_policy(**kwargs)¶Deletes the specified inline policy that is embedded in the specified IAM user.
A user can also have managed policies attached to it. To detach a managed policy from a user, use DetachUserPolicy . For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_user_policy(
UserName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following delete-user-policy command removes the specified policy from the IAM user named Juan:
response = client.delete_user_policy(
PolicyName='ExamplePolicy',
UserName='Juan',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_virtual_mfa_device(**kwargs)¶Deletes a virtual MFA device.
Note
You must deactivate a user’s virtual MFA device before you can delete it. For information about deactivating MFA devices, see DeactivateMFADevice .
See also: AWS API Documentation
Request Syntax
response = client.delete_virtual_mfa_device(
SerialNumber='string'
)
| Parameters: | SerialNumber (string) – [REQUIRED] The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the same as the ARN. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@:/- |
|---|---|
| Returns: | None |
Examples
The following delete-virtual-mfa-device command removes the specified MFA device from the current AWS account.
response = client.delete_virtual_mfa_device(
SerialNumber='arn:aws:iam::123456789012:mfa/ExampleName',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
detach_group_policy(**kwargs)¶Removes the specified managed policy from the specified IAM group.
A group can also have inline policies embedded with it. To delete an inline policy, use the DeleteGroupPolicy API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.detach_group_policy(
GroupName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
detach_role_policy(**kwargs)¶Removes the specified managed policy from the specified role.
A role can also have inline policies embedded with it. To delete an inline policy, use the DeleteRolePolicy API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.detach_role_policy(
RoleName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
detach_user_policy(**kwargs)¶Removes the specified managed policy from the specified user.
A user can also have inline policies embedded with it. To delete an inline policy, use the DeleteUserPolicy API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.detach_user_policy(
UserName='string',
PolicyArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
enable_mfa_device(**kwargs)¶Enables the specified MFA device and associates it with the specified IAM user. When enabled, the MFA device is required for every subsequent login by the IAM user associated with the device.
See also: AWS API Documentation
Request Syntax
response = client.enable_mfa_device(
UserName='string',
SerialNumber='string',
AuthenticationCode1='string',
AuthenticationCode2='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
generate_credential_report()¶Generates a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.generate_credential_report()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'State': 'STARTED'|'INPROGRESS'|'COMPLETE',
'Description': 'string'
}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_access_key_last_used(**kwargs)¶Retrieves information about when the specified access key was last used. The information includes the date and time of last use, along with the AWS service and region that were specified in the last request made with that key.
See also: AWS API Documentation
Request Syntax
response = client.get_access_key_last_used(
AccessKeyId='string'
)
| Parameters: | AccessKeyId (string) – [REQUIRED] The identifier of an access key. This parameter allows (per its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'UserName': 'string',
'AccessKeyLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'Region': 'string'
}
}
Response Structure
|
Retrieves information about all IAM users, groups, roles, and policies in your AWS account, including their relationships to one another. Use this API to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account.
You can optionally filter the results using the Filter parameter. You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.get_account_authorization_details(
Filter=[
'User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
],
MaxItems=123,
Marker='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'UserDetailList': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'UserPolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'GroupList': [
'string',
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'GroupDetailList': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'GroupPolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'RoleDetailList': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'InstanceProfileList': [
{
'Path': 'string',
'InstanceProfileName': 'string',
'InstanceProfileId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
},
]
},
],
'RolePolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'PolicyVersionList': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
get_account_password_policy()¶Retrieves the password policy for the AWS account. For more information about using a password policy, go to Managing an IAM Password Policy .
See also: AWS API Documentation
Request Syntax
response = client.get_account_password_policy()
| Return type: | 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
|
Examples
The following command displays details about the password policy for the current AWS account.
response = client.get_account_password_policy(
)
print(response)
Expected Output:
{
'PasswordPolicy': {
'AllowUsersToChangePassword': False,
'ExpirePasswords': False,
'HardExpiry': False,
'MaxPasswordAge': 90,
'MinimumPasswordLength': 8,
'PasswordReusePrevention': 12,
'RequireLowercaseCharacters': False,
'RequireNumbers': True,
'RequireSymbols': True,
'RequireUppercaseCharacters': False,
},
'ResponseMetadata': {
'...': '...',
},
}
get_account_summary()¶Retrieves information about IAM entity usage and IAM quotas in the AWS account.
For information about limitations on IAM entities, see Limitations on IAM Entities in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_account_summary()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'SummaryMap': {
'string': 123
}
}
Response Structure
|
Examples
The following command returns information about the IAM entity quotas and usage in the current AWS account.
response = client.get_account_summary(
)
print(response)
Expected Output:
{
'SummaryMap': {
'AccessKeysPerUserQuota': 2,
'AccountAccessKeysPresent': 1,
'AccountMFAEnabled': 0,
'AccountSigningCertificatesPresent': 0,
'AttachedPoliciesPerGroupQuota': 10,
'AttachedPoliciesPerRoleQuota': 10,
'AttachedPoliciesPerUserQuota': 10,
'GroupPolicySizeQuota': 5120,
'Groups': 15,
'GroupsPerUserQuota': 10,
'GroupsQuota': 100,
'MFADevices': 6,
'MFADevicesInUse': 3,
'Policies': 8,
'PoliciesQuota': 1000,
'PolicySizeQuota': 5120,
'PolicyVersionsInUse': 22,
'PolicyVersionsInUseQuota': 10000,
'ServerCertificates': 1,
'ServerCertificatesQuota': 20,
'SigningCertificatesPerUserQuota': 2,
'UserPolicySizeQuota': 2048,
'Users': 27,
'UsersQuota': 5000,
'VersionsPerPolicyQuota': 5,
},
'ResponseMetadata': {
'...': '...',
},
}
get_context_keys_for_custom_policy(**kwargs)¶Gets a list of all of the context keys referenced in the input policies. The policies are supplied as a list of one or more strings. To get the context keys from policies associated with an IAM user, group, or role, use GetContextKeysForPrincipalPolicy .
Context keys are variables maintained by AWS and its services that provide details about the context of an API query request, and can be evaluated by testing against a value specified in an IAM policy. Use GetContextKeysForCustomPolicy to understand what key names and values you must supply when you call SimulateCustomPolicy . Note that all parameters are shown in unencoded form here for clarity, but must be URL encoded to be included as a part of a real HTML request.
See also: AWS API Documentation
Request Syntax
response = client.get_context_keys_for_custom_policy(
PolicyInputList=[
'string',
]
)
| Parameters: | PolicyInputList (list) – [REQUIRED] A list of policies for which you want the list of context keys referenced in those policies. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through u00FF). It also includes the special characters tab (u0009), line feed (u000A), and carriage return (u000D).
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'ContextKeyNames': [
'string',
]
}
Response Structure
|
get_context_keys_for_principal_policy(**kwargs)¶Gets a list of all of the context keys referenced in all of the IAM policies attached to the specified IAM entity. The entity can be an IAM user, group, or role. If you specify a user, then the request also includes all of the policies attached to groups that the user is a member of.
You can optionally include a list of one or more additional policies, specified as strings. If you want to include only a list of policies by string, use GetContextKeysForCustomPolicy instead.
Note: This API discloses information about the permissions granted to other users. If you do not want users to see other user’s permissions, then consider allowing them to use GetContextKeysForCustomPolicy instead.
Context keys are variables maintained by AWS and its services that provide details about the context of an API query request, and can be evaluated by testing against a value in an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what key names and values you must supply when you call SimulatePrincipalPolicy .
See also: AWS API Documentation
Request Syntax
response = client.get_context_keys_for_principal_policy(
PolicySourceArn='string',
PolicyInputList=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ContextKeyNames': [
'string',
]
}
Response Structure
|
get_credential_report()¶Retrieves a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_credential_report()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Content': b'bytes',
'ReportFormat': 'text/csv',
'GeneratedTime': datetime(2015, 1, 1)
}
Response Structure
|
get_group(**kwargs)¶Returns a list of IAM users that are in the specified IAM group. You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.get_group(
GroupName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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),
'PasswordLastUsed': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
get_group_policy(**kwargs)¶Retrieves the specified inline policy document that is embedded in the specified IAM group.
Note
Policies returned by this API are URL-encoded compliant with RFC 3986 . You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.
An IAM group can also have managed policies attached to it. To retrieve a managed policy document that is attached to a group, use GetPolicy to determine the policy’s default version, then use GetPolicyVersion to retrieve the policy document.
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_group_policy(
GroupName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'GroupName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
|
get_instance_profile(**kwargs)¶Retrieves information about the specified instance profile, including the instance profile’s path, GUID, ARN, and role. For more information about instance profiles, see About Instance Profiles in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_instance_profile(
InstanceProfileName='string'
)
| Parameters: | InstanceProfileName (string) – [REQUIRED] The name of the instance profile to get information about. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
}
}
Response Structure
|
Examples
The following command gets information about the instance profile named ExampleInstanceProfile.
response = client.get_instance_profile(
InstanceProfileName='ExampleInstanceProfile',
)
print(response)
Expected Output:
{
'InstanceProfile': {
'Arn': 'arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile',
'CreateDate': datetime(2013, 6, 12, 23, 52, 2, 2, 163, 0),
'InstanceProfileId': 'AID2MAB8DPLSRHEXAMPLE',
'InstanceProfileName': 'ExampleInstanceProfile',
'Path': '/',
'Roles': [
{
'Arn': 'arn:aws:iam::336924118301:role/Test-Role',
'AssumeRolePolicyDocument': '<URL-encoded-JSON>',
'CreateDate': datetime(2013, 1, 9, 6, 33, 26, 2, 9, 0),
'Path': '/',
'RoleId': 'AIDGPMS9RO4H3FEXAMPLE',
'RoleName': 'Test-Role',
},
],
},
'ResponseMetadata': {
'...': '...',
},
}
get_login_profile(**kwargs)¶Retrieves the user name and password-creation date for the specified IAM user. If the user has not been assigned a password, the action returns a 404 (NoSuchEntity ) error.
See also: AWS API Documentation
Request Syntax
response = client.get_login_profile(
UserName='string'
)
| Parameters: | UserName (string) – [REQUIRED] The name of the user whose login profile you want to retrieve. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'LoginProfile': {
'UserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordResetRequired': True|False
}
}
Response Structure
|
Examples
The following command gets information about the password for the IAM user named Anika.
response = client.get_login_profile(
UserName='Anika',
)
print(response)
Expected Output:
{
'LoginProfile': {
'CreateDate': datetime(2012, 9, 21, 23, 3, 39, 4, 265, 0),
'UserName': 'Anika',
},
'ResponseMetadata': {
'...': '...',
},
}
get_open_id_connect_provider(**kwargs)¶Returns information about the specified OpenID Connect (OIDC) provider resource object in IAM.
See also: AWS API Documentation
Request Syntax
response = client.get_open_id_connect_provider(
OpenIDConnectProviderArn='string'
)
| Parameters: | OpenIDConnectProviderArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the OIDC provider resource object in IAM to get information for. You can get a list of OIDC provider resource ARNs by using the ListOpenIDConnectProviders action. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference . |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Url': 'string',
'ClientIDList': [
'string',
],
'ThumbprintList': [
'string',
],
'CreateDate': datetime(2015, 1, 1)
}
Response Structure
|
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_policy(**kwargs)¶Retrieves information about the specified managed policy, including the policy’s default version and the total number of IAM users, groups, and roles to which the policy is attached. To retrieve the list of the specific users, groups, and roles that the policy is attached to, use the ListEntitiesForPolicy API. This API returns metadata about the policy. To retrieve the actual policy document for a specific version of the policy, use GetPolicyVersion .
This API retrieves information about managed policies. To retrieve information about an inline policy that is embedded with an IAM user, group, or role, use the GetUserPolicy , GetGroupPolicy , or GetRolePolicy API.
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_policy(
PolicyArn='string'
)
| Parameters: | PolicyArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the managed policy that you want information about. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference . |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Policy': {
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
get_policy_version(**kwargs)¶Retrieves information about the specified version of the specified managed policy, including the policy document.
Note
Policies returned by this API are URL-encoded compliant with RFC 3986 . You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.
To list the available versions for a policy, use ListPolicyVersions .
This API retrieves information about managed policies. To retrieve information about an inline policy that is embedded in a user, group, or role, use the GetUserPolicy , GetGroupPolicy , or GetRolePolicy API.
For more information about the types of policies, see Managed Policies and Inline Policies in the IAM User Guide .
For more information about managed policy versions, see Versioning for Managed Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_policy_version(
PolicyArn='string',
VersionId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyVersion': {
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
|
get_role(**kwargs)¶Retrieves information about the specified role, including the role’s path, GUID, ARN, and the role’s trust policy that grants permission to assume the role. For more information about roles, see Working with Roles .
Note
Policies returned by this API are URL-encoded compliant with RFC 3986 . You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.
See also: AWS API Documentation
Request Syntax
response = client.get_role(
RoleName='string'
)
| Parameters: | RoleName (string) – [REQUIRED] The name of the IAM role to get information about. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@- |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
}
}
Response Structure
|
Examples
The following command gets information about the role named Test-Role.
response = client.get_role(
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'Role': {
'Arn': 'arn:aws:iam::123456789012:role/Test-Role',
'AssumeRolePolicyDocument': '<URL-encoded-JSON>',
'CreateDate': datetime(2013, 4, 18, 5, 1, 58, 3, 108, 0),
'Path': '/',
'RoleId': 'AIDIODR4TAW7CSEXAMPLE',
'RoleName': 'Test-Role',
},
'ResponseMetadata': {
'...': '...',
},
}
get_role_policy(**kwargs)¶Retrieves the specified inline policy document that is embedded with the specified IAM role.
Note
Policies returned by this API are URL-encoded compliant with RFC 3986 . You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.
An IAM role can also have managed policies attached to it. To retrieve a managed policy document that is attached to a role, use GetPolicy to determine the policy’s default version, then use GetPolicyVersion to retrieve the policy document.
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
For more information about roles, see Using Roles to Delegate Permissions and Federate Identities .
See also: AWS API Documentation
Request Syntax
response = client.get_role_policy(
RoleName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'RoleName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
|
get_saml_provider(**kwargs)¶Returns the SAML provider metadocument that was uploaded when the IAM SAML provider resource object was created or updated.
Note
This operation requires Signature Version 4 .
See also: AWS API Documentation
Request Syntax
response = client.get_saml_provider(
SAMLProviderArn='string'
)
| Parameters: | SAMLProviderArn (string) – [REQUIRED] The Amazon Resource Name (ARN) of the SAML provider resource object in IAM to get information about. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference . |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'SAMLMetadataDocument': 'string',
'CreateDate': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1)
}
Response Structure
|
get_server_certificate(**kwargs)¶Retrieves information about the specified server certificate stored in IAM.
For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_server_certificate(
ServerCertificateName='string'
)
| Parameters: | ServerCertificateName (string) – [REQUIRED] The name of the server certificate you want to retrieve information about. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Return type: | 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
|
get_ssh_public_key(**kwargs)¶Retrieves the specified SSH public key, including metadata about the key.
The SSH public key retrieved by this action is used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections in the AWS CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_ssh_public_key(
UserName='string',
SSHPublicKeyId='string',
Encoding='SSH'|'PEM'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SSHPublicKey': {
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Fingerprint': 'string',
'SSHPublicKeyBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
|
get_user(**kwargs)¶Retrieves information about the specified IAM user, including the user’s creation date, 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 used to sign the request to this API.
See also: AWS API Documentation
Request Syntax
response = client.get_user(
UserName='string'
)
| Parameters: | UserName (string) – The 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. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'User': {
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following command gets information about the IAM user named Bob.
response = client.get_user(
UserName='Bob',
)
print(response)
Expected Output:
{
'User': {
'Arn': 'arn:aws:iam::123456789012:user/Bob',
'CreateDate': datetime(2012, 9, 21, 23, 3, 13, 4, 265, 0),
'Path': '/',
'UserId': 'AKIAIOSFODNN7EXAMPLE',
'UserName': 'Bob',
},
'ResponseMetadata': {
'...': '...',
},
}
get_user_policy(**kwargs)¶Retrieves the specified inline policy document that is embedded in the specified IAM user.
Note
Policies returned by this API are URL-encoded compliant with RFC 3986 . You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.
An IAM user can also have managed policies attached to it. To retrieve a managed policy document that is attached to a user, use GetPolicy to determine the policy’s default version, then use GetPolicyVersion to retrieve the policy document.
For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_user_policy(
UserName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'UserName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
|
get_waiter(waiter_name)¶list_access_keys(**kwargs)¶Returns information about the access key IDs associated with the specified IAM 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, you can use this action to manage root credentials even if the AWS account has no associated users.
Note
To ensure the security of your AWS account, the secret access key is accessible only during key and user creation.
See also: AWS API Documentation
Request Syntax
response = client.list_access_keys(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AccessKeyMetadata': [
{
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
Examples
The following command lists the access keys IDs for the IAM user named Alice.
response = client.list_access_keys(
UserName='Alice',
)
print(response)
Expected Output:
{
'AccessKeyMetadata': [
{
'AccessKeyId': 'AKIA111111111EXAMPLE',
'CreateDate': datetime(2016, 12, 1, 22, 19, 58, 3, 336, 0),
'Status': 'Active',
'UserName': 'Alice',
},
{
'AccessKeyId': 'AKIA222222222EXAMPLE',
'CreateDate': datetime(2016, 12, 1, 22, 20, 1, 3, 336, 0),
'Status': 'Active',
'UserName': 'Alice',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_account_aliases(**kwargs)¶Lists the account alias associated with the AWS account (Note: you can have only one). For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_account_aliases(
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AccountAliases': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
Examples
The following command lists the aliases for the current account.
response = client.list_account_aliases(
)
print(response)
Expected Output:
{
'AccountAliases': [
'exmaple-corporation',
],
'ResponseMetadata': {
'...': '...',
},
}
list_attached_group_policies(**kwargs)¶Lists all managed policies that are attached to the specified IAM group.
An IAM group can also have inline policies embedded with it. To list the inline policies for a group, use the ListGroupPolicies API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified group (or none that match the specified path prefix), the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_attached_group_policies(
GroupName='string',
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_attached_role_policies(**kwargs)¶Lists all managed policies that are attached to the specified IAM role.
An IAM role can also have inline policies embedded with it. To list the inline policies for a role, use the ListRolePolicies API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified role (or none that match the specified path prefix), the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_attached_role_policies(
RoleName='string',
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_attached_user_policies(**kwargs)¶Lists all managed policies that are attached to the specified IAM user.
An IAM user can also have inline policies embedded with it. To list the inline policies for a user, use the ListUserPolicies API. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified group (or none that match the specified path prefix), the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_attached_user_policies(
UserName='string',
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_entities_for_policy(**kwargs)¶Lists all IAM users, groups, and roles that the specified managed policy is attached to.
You can use the optional EntityFilter parameter to limit the results to a particular type of entity (users, groups, or roles). For example, to list only the roles that are attached to the specified policy, set EntityFilter to Role .
You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_entities_for_policy(
PolicyArn='string',
EntityFilter='User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'PolicyUsers': [
{
'UserName': 'string',
'UserId': 'string'
},
],
'PolicyRoles': [
{
'RoleName': 'string',
'RoleId': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_group_policies(**kwargs)¶Lists the names of the inline policies that are embedded in the specified IAM group.
An IAM group can also have managed policies attached to it. To list the managed policies that are attached to a group, use ListAttachedGroupPolicies . For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified group, the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_group_policies(
GroupName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
Examples
The following command lists the names of in-line policies that are embedded in the IAM group named Admins.
response = client.list_group_policies(
GroupName='Admins',
)
print(response)
Expected Output:
{
'PolicyNames': [
'AdminRoot',
'KeyPolicy',
],
'ResponseMetadata': {
'...': '...',
},
}
list_groups(**kwargs)¶Lists the IAM groups that have the specified path prefix.
You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_groups(
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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
|
Examples
The following command lists the IAM groups in the current account:
response = client.list_groups(
)
print(response)
Expected Output:
{
'Groups': [
{
'Arn': 'arn:aws:iam::123456789012:group/Admins',
'CreateDate': datetime(2016, 12, 15, 21, 40, 8, 3, 350, 0),
'GroupId': 'AGPA1111111111EXAMPLE',
'GroupName': 'Admins',
'Path': '/division_abc/subdivision_xyz/',
},
{
'Arn': 'arn:aws:iam::123456789012:group/division_abc/subdivision_xyz/product_1234/engineering/Test',
'CreateDate': datetime(2016, 11, 30, 14, 10, 1, 2, 335, 0),
'GroupId': 'AGP22222222222EXAMPLE',
'GroupName': 'Test',
'Path': '/division_abc/subdivision_xyz/product_1234/engineering/',
},
{
'Arn': 'arn:aws:iam::123456789012:group/division_abc/subdivision_xyz/product_1234/Managers',
'CreateDate': datetime(2016, 6, 12, 20, 14, 52, 6, 164, 0),
'GroupId': 'AGPI3333333333EXAMPLE',
'GroupName': 'Managers',
'Path': '/division_abc/subdivision_xyz/product_1234/',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_groups_for_user(**kwargs)¶Lists the IAM groups that the specified IAM user belongs to.
You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_groups_for_user(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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
|
Examples
The following command displays the groups that the IAM user named Bob belongs to.
response = client.list_groups_for_user(
UserName='Bob',
)
print(response)
Expected Output:
{
'Groups': [
{
'Arn': 'arn:aws:iam::123456789012:group/division_abc/subdivision_xyz/product_1234/engineering/Test',
'CreateDate': datetime(2016, 11, 30, 14, 10, 1, 2, 335, 0),
'GroupId': 'AGP2111111111EXAMPLE',
'GroupName': 'Test',
'Path': '/division_abc/subdivision_xyz/product_1234/engineering/',
},
{
'Arn': 'arn:aws:iam::123456789012:group/division_abc/subdivision_xyz/product_1234/Managers',
'CreateDate': datetime(2016, 6, 12, 20, 14, 52, 6, 164, 0),
'GroupId': 'AGPI222222222SEXAMPLE',
'GroupName': 'Managers',
'Path': '/division_abc/subdivision_xyz/product_1234/',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_instance_profiles(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.list_instance_profiles(
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_instance_profiles_for_role(**kwargs)¶Lists the instance profiles that have the specified associated IAM 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.
See also: AWS API Documentation
Request Syntax
response = client.list_instance_profiles_for_role(
RoleName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_mfa_devices(**kwargs)¶Lists the MFA devices for an IAM user. If the request includes a IAM user name, then this action lists all the MFA devices 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 for this API.
You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_mfa_devices(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MFADevices': [
{
'UserName': 'string',
'SerialNumber': 'string',
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_open_id_connect_providers()¶Lists information about the IAM OpenID Connect (OIDC) provider resource objects defined in the AWS account.
See also: AWS API Documentation
Request Syntax
response = client.list_open_id_connect_providers()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'OpenIDConnectProviderList': [
{
'Arn': 'string'
},
]
}
Response Structure
|
list_policies(**kwargs)¶Lists all the managed policies that are available in your AWS account, including your own customer-defined managed policies and all AWS managed policies.
You can filter the list of policies that is returned using the optional OnlyAttached , Scope , and PathPrefix parameters. For example, to list only the customer managed policies in your AWS account, set Scope to Local . To list only AWS managed policies, set Scope to AWS .
You can paginate the results using the MaxItems and Marker parameters.
For more information about managed policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_policies(
Scope='All'|'AWS'|'Local',
OnlyAttached=True|False,
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_policy_versions(**kwargs)¶Lists information about the versions of the specified managed policy, including the version that is currently set as the policy’s default version.
For more information about managed policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_policy_versions(
PolicyArn='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Versions': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_role_policies(**kwargs)¶Lists the names of the inline policies that are embedded in the specified IAM role.
An IAM role can also have managed policies attached to it. To list the managed policies that are attached to a role, use ListAttachedRolePolicies . For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified role, the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_role_policies(
RoleName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_roles(**kwargs)¶Lists the IAM 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.
See also: AWS API Documentation
Request Syntax
response = client.list_roles(
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_saml_providers()¶Lists the SAML provider resource objects defined in IAM in the account.
Note
This operation requires Signature Version 4 .
See also: AWS API Documentation
Request Syntax
response = client.list_saml_providers()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'SAMLProviderList': [
{
'Arn': 'string',
'ValidUntil': datetime(2015, 1, 1),
'CreateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
|
list_server_certificates(**kwargs)¶Lists the server certificates stored in IAM 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.
For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_server_certificates(
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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
|
list_service_specific_credentials(**kwargs)¶Returns information about the service-specific credentials associated with the specified IAM user. If there are none, the action returns an empty list. The service-specific credentials returned by this action are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an AWS service, see Set Up service-specific credentials in the AWS CodeCommit User Guide.
See also: AWS API Documentation
Request Syntax
response = client.list_service_specific_credentials(
UserName='string',
ServiceName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ServiceSpecificCredentials': [
{
'UserName': 'string',
'Status': 'Active'|'Inactive',
'ServiceUserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'ServiceSpecificCredentialId': 'string',
'ServiceName': 'string'
},
]
}
Response Structure
|
list_signing_certificates(**kwargs)¶Returns information about the signing certificates associated with the specified IAM 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 for this API. Because this action works for access keys under the AWS account, you can use this action to manage root credentials even if the AWS account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.list_signing_certificates(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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
|
Examples
The following command lists the signing certificates for the IAM user named Bob.
response = client.list_signing_certificates(
UserName='Bob',
)
print(response)
Expected Output:
{
'Certificates': [
{
'CertificateBody': '-----BEGIN CERTIFICATE-----<certificate-body>-----END CERTIFICATE-----',
'CertificateId': 'TA7SMP42TDN5Z26OBPJE7EXAMPLE',
'Status': 'Active',
'UploadDate': datetime(2013, 6, 6, 21, 40, 8, 3, 157, 0),
'UserName': 'Bob',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_ssh_public_keys(**kwargs)¶Returns information about the SSH public keys associated with the specified IAM user. If there are none, the action returns an empty list.
The SSH public keys returned by this action are used only for authenticating the IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections in the AWS CodeCommit User Guide .
Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_ssh_public_keys(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SSHPublicKeys': [
{
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_user_policies(**kwargs)¶Lists the names of the inline policies embedded in the specified IAM user.
An IAM user can also have managed policies attached to it. To list the managed policies that are attached to a user, use ListAttachedUserPolicies . For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified user, the action returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_user_policies(
UserName='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
list_users(**kwargs)¶Lists the IAM users that have the specified path prefix. If no path prefix is specified, the action returns all users in the AWS account. If there are none, the action returns an empty list.
You can paginate the results using the MaxItems and Marker parameters.
See also: AWS API Documentation
Request Syntax
response = client.list_users(
PathPrefix='string',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Users': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
Examples
The following command lists the IAM users in the current account.
response = client.list_users(
)
print(response)
Expected Output:
{
'Users': [
{
'Arn': 'arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/engineering/Juan',
'CreateDate': datetime(2012, 9, 5, 19, 38, 48, 2, 249, 0),
'PasswordLastUsed': datetime(2016, 9, 8, 21, 47, 36, 3, 252, 0),
'Path': '/division_abc/subdivision_xyz/engineering/',
'UserId': 'AID2MAB8DPLSRHEXAMPLE',
'UserName': 'Juan',
},
{
'Arn': 'arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/engineering/Anika',
'CreateDate': datetime(2014, 4, 9, 15, 43, 45, 2, 99, 0),
'PasswordLastUsed': datetime(2016, 9, 24, 16, 18, 7, 5, 268, 0),
'Path': '/division_abc/subdivision_xyz/engineering/',
'UserId': 'AIDIODR4TAW7CSEXAMPLE',
'UserName': 'Anika',
},
],
'ResponseMetadata': {
'...': '...',
},
}
list_virtual_mfa_devices(**kwargs)¶Lists the virtual MFA devices defined in 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.
See also: AWS API Documentation
Request Syntax
response = client.list_virtual_mfa_devices(
AssignmentStatus='Assigned'|'Unassigned'|'Any',
Marker='string',
MaxItems=123
)
| Parameters: |
|
|---|---|
| Return type: | 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),
'PasswordLastUsed': datetime(2015, 1, 1)
},
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
Examples
The following command lists the virtual MFA devices that have been configured for the current account.
response = client.list_virtual_mfa_devices(
)
print(response)
Expected Output:
{
'VirtualMFADevices': [
{
'SerialNumber': 'arn:aws:iam::123456789012:mfa/ExampleMFADevice',
},
{
'SerialNumber': 'arn:aws:iam::123456789012:mfa/Juan',
},
],
'ResponseMetadata': {
'...': '...',
},
}
put_group_policy(**kwargs)¶Adds or updates an inline policy document that is embedded in the specified IAM group.
A user can also have managed policies attached to it. To attach a managed policy to a group, use AttachGroupPolicy . To create a new managed policy, use CreatePolicy . For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
For information about limits on the number of inline policies that you can embed in a group, see Limitations on IAM Entities in the IAM User Guide .
Note
Because policy documents can be large, you should use POST rather than GET when calling PutGroupPolicy . For general information about using the Query API with IAM, go to Making Query Requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_group_policy(
GroupName='string',
PolicyName='string',
PolicyDocument='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command adds a policy named AllPerms to the IAM group named Admins.
response = client.put_group_policy(
GroupName='Admins',
PolicyDocument='{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"*","Resource":"*"}}',
PolicyName='AllPerms',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
put_role_policy(**kwargs)¶Adds or updates an inline policy document that is embedded in the specified IAM role.
When you embed an inline policy in a role, the inline policy is used as part of the role’s access (permissions) policy. The role’s trust policy is created at the same time as the role, using CreateRole . You can update a role’s trust policy using UpdateAssumeRolePolicy . For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities .
A role can also have a managed policy attached to it. To attach a managed policy to a role, use AttachRolePolicy . To create a new managed policy, use CreatePolicy . For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
For information about limits on the number of inline policies that you can embed with a role, see Limitations on IAM Entities in the IAM User Guide .
Note
Because policy documents can be large, you should use POST rather than GET when calling PutRolePolicy . For general information about using the Query API with IAM, go to Making Query Requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_role_policy(
RoleName='string',
PolicyName='string',
PolicyDocument='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command adds a permissions policy to the role named Test-Role.
response = client.put_role_policy(
PolicyDocument='{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"s3:*","Resource":"*"}}',
PolicyName='S3AccessPolicy',
RoleName='S3Access',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
put_user_policy(**kwargs)¶Adds or updates an inline policy document that is embedded in the specified IAM user.
An IAM user can also have a managed policy attached to it. To attach a managed policy to a user, use AttachUserPolicy . To create a new managed policy, use CreatePolicy . For information about policies, see Managed Policies and Inline Policies in the IAM User Guide .
For information about limits on the number of inline policies that you can embed in a user, see Limitations on IAM Entities in the IAM User Guide .
Note
Because policy documents can be large, you should use POST rather than GET when calling PutUserPolicy . For general information about using the Query API with IAM, go to Making Query Requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_user_policy(
UserName='string',
PolicyName='string',
PolicyDocument='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command attaches a policy to the IAM user named Bob.
response = client.put_user_policy(
PolicyDocument='{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"*","Resource":"*"}}',
PolicyName='AllAccessPolicy',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
remove_client_id_from_open_id_connect_provider(**kwargs)¶Removes the specified client ID (also known as audience) from the list of client IDs registered for the specified IAM OpenID Connect (OIDC) provider resource object.
This action is idempotent; it does not fail or return an error if you try to remove a client ID that does not exist.
See also: AWS API Documentation
Request Syntax
response = client.remove_client_id_from_open_id_connect_provider(
OpenIDConnectProviderArn='string',
ClientID='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
remove_role_from_instance_profile(**kwargs)¶Removes the specified IAM role from the specified EC2 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 might break any applications running on the instance.
For more information about IAM roles, go to Working with Roles . For more information about instance profiles, go to About Instance Profiles .
See also: AWS API Documentation
Request Syntax
response = client.remove_role_from_instance_profile(
InstanceProfileName='string',
RoleName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command removes the role named Test-Role from the instance profile named ExampleInstanceProfile.
response = client.remove_role_from_instance_profile(
InstanceProfileName='ExampleInstanceProfile',
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
remove_user_from_group(**kwargs)¶Removes the specified user from the specified group.
See also: AWS API Documentation
Request Syntax
response = client.remove_user_from_group(
GroupName='string',
UserName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command removes the user named Bob from the IAM group named Admins.
response = client.remove_user_from_group(
GroupName='Admins',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
reset_service_specific_credential(**kwargs)¶Resets the password for a service-specific credential. The new password is AWS generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.
See also: AWS API Documentation
Request Syntax
response = client.reset_service_specific_credential(
UserName='string',
ServiceSpecificCredentialId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ServiceSpecificCredential': {
'CreateDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'ServiceUserName': 'string',
'ServicePassword': 'string',
'ServiceSpecificCredentialId': 'string',
'UserName': 'string',
'Status': 'Active'|'Inactive'
}
}
Response Structure
|
resync_mfa_device(**kwargs)¶Synchronizes the specified MFA device with its IAM resource object on the AWS servers.
For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.resync_mfa_device(
UserName='string',
SerialNumber='string',
AuthenticationCode1='string',
AuthenticationCode2='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
set_default_policy_version(**kwargs)¶Sets the specified version of the specified policy as the policy’s default (operative) version.
This action affects all users, groups, and roles that the policy is attached to. To list the users, groups, and roles that the policy is attached to, use the ListEntitiesForPolicy API.
For information about managed policies, see Managed Policies and Inline Policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_default_policy_version(
PolicyArn='string',
VersionId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
simulate_custom_policy(**kwargs)¶Simulate how a set of IAM policies and optionally a resource-based policy works with a list of API actions and AWS resources to determine the policies’ effective permissions. The policies are provided as strings.
The simulation does not perform the API actions; it only checks the authorization to determine if the simulated policies allow or deny the actions.
If you want to simulate existing policies attached to an IAM user, group, or role, use SimulatePrincipalPolicy instead.
Context keys are variables maintained by AWS and its services that provide details about the context of an API query request. You can use the Condition element of an IAM policy to evaluate context keys. To get the list of context keys that the policies require for correct simulation, use GetContextKeysForCustomPolicy .
If the output is long, you can use MaxItems and Marker parameters to paginate the results.
See also: AWS API Documentation
Request Syntax
response = client.simulate_custom_policy(
PolicyInputList=[
'string',
],
ActionNames=[
'string',
],
ResourceArns=[
'string',
],
ResourcePolicy='string',
ResourceOwner='string',
CallerArn='string',
ContextEntries=[
{
'ContextKeyName': 'string',
'ContextKeyValues': [
'string',
],
'ContextKeyType': 'string'|'stringList'|'numeric'|'numericList'|'boolean'|'booleanList'|'ip'|'ipList'|'binary'|'binaryList'|'date'|'dateList'
},
],
ResourceHandlingOption='string',
MaxItems=123,
Marker='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationResults': [
{
'EvalActionName': 'string',
'EvalResourceName': 'string',
'EvalDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'OrganizationsDecisionDetail': {
'AllowedByOrganizations': True|False
},
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
},
'ResourceSpecificResults': [
{
'EvalResourceName': 'string',
'EvalResourceDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
}
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
simulate_principal_policy(**kwargs)¶Simulate how a set of IAM policies attached to an IAM entity works with a list of API actions and AWS resources to determine the policies’ effective permissions. The entity can be an IAM user, group, or role. If you specify a user, then the simulation also includes all of the policies that are attached to groups that the user belongs to .
You can optionally include a list of one or more additional policies specified as strings to include in the simulation. If you want to simulate only policies specified as strings, use SimulateCustomPolicy instead.
You can also optionally include one resource-based policy to be evaluated with each of the resources included in the simulation.
The simulation does not perform the API actions, it only checks the authorization to determine if the simulated policies allow or deny the actions.
Note: This API discloses information about the permissions granted to other users. If you do not want users to see other user’s permissions, then consider allowing them to use SimulateCustomPolicy instead.
Context keys are variables maintained by AWS and its services that provide details about the context of an API query request. You can use the Condition element of an IAM policy to evaluate context keys. To get the list of context keys that the policies require for correct simulation, use GetContextKeysForPrincipalPolicy .
If the output is long, you can use the MaxItems and Marker parameters to paginate the results.
See also: AWS API Documentation
Request Syntax
response = client.simulate_principal_policy(
PolicySourceArn='string',
PolicyInputList=[
'string',
],
ActionNames=[
'string',
],
ResourceArns=[
'string',
],
ResourcePolicy='string',
ResourceOwner='string',
CallerArn='string',
ContextEntries=[
{
'ContextKeyName': 'string',
'ContextKeyValues': [
'string',
],
'ContextKeyType': 'string'|'stringList'|'numeric'|'numericList'|'boolean'|'booleanList'|'ip'|'ipList'|'binary'|'binaryList'|'date'|'dateList'
},
],
ResourceHandlingOption='string',
MaxItems=123,
Marker='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationResults': [
{
'EvalActionName': 'string',
'EvalResourceName': 'string',
'EvalDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'OrganizationsDecisionDetail': {
'AllowedByOrganizations': True|False
},
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
},
'ResourceSpecificResults': [
{
'EvalResourceName': 'string',
'EvalResourceDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
}
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
|
update_access_key(**kwargs)¶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, you can use this action 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 IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_access_key(
UserName='string',
AccessKeyId='string',
Status='Active'|'Inactive'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command deactivates the specified access key (access key ID and secret access key) for the IAM user named Bob.
response = client.update_access_key(
AccessKeyId='AKIAIOSFODNN7EXAMPLE',
Status='Inactive',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_account_password_policy(**kwargs)¶Updates the password policy settings for the AWS account.
Note
This action does not support partial updates. No parameters are required, but if you do not specify a parameter, that parameter’s value reverts to its default value. See the Request Parameters section for each parameter’s default value.
For more information about using a password policy, see Managing an IAM Password Policy in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = 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
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command sets the password policy to require a minimum length of eight characters and to require one or more numbers in the password:
response = client.update_account_password_policy(
MinimumPasswordLength=8,
RequireNumbers=True,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_assume_role_policy(**kwargs)¶Updates the policy that grants an IAM entity permission to assume a role. This is typically referred to as the “role trust policy”. For more information about roles, go to Using Roles to Delegate Permissions and Federate Identities .
See also: AWS API Documentation
Request Syntax
response = client.update_assume_role_policy(
RoleName='string',
PolicyDocument='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command updates the role trust policy for the role named Test-Role:
response = client.update_assume_role_policy(
PolicyDocument='{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":["ec2.amazonaws.com"]},"Action":["sts:AssumeRole"]}]}',
RoleName='S3AccessForEC2Instances',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_group(**kwargs)¶Updates the name and/or the path of the specified IAM 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 IAM User Guide .
Note
To change an IAM group name the requester must have appropriate permissions on both the source object and the target object. For example, to change “Managers” to “MGRs”, the entity making the request must have permission on both “Managers” and “MGRs”, or must have permission on all (*). For more information about permissions, see Permissions and Policies .
See also: AWS API Documentation
Request Syntax
response = client.update_group(
GroupName='string',
NewPath='string',
NewGroupName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command changes the name of the IAM group Test to Test-1.
response = client.update_group(
GroupName='Test',
NewGroupName='Test-1',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_login_profile(**kwargs)¶Changes the password for the specified IAM user.
IAM users can change their own passwords by calling ChangePassword . For more information about modifying passwords, see Managing Passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_login_profile(
UserName='string',
Password='string',
PasswordResetRequired=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command creates or changes the password for the IAM user named Bob.
response = client.update_login_profile(
Password='SomeKindOfPassword123!@#',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_open_id_connect_provider_thumbprint(**kwargs)¶Replaces the existing list of server certificate thumbprints associated with an OpenID Connect (OIDC) provider resource object with a new list of thumbprints.
The list that you pass with this action completely replaces the existing list of thumbprints. (The lists are not merged.)
Typically, you need to update a thumbprint only when the identity provider’s certificate changes, which occurs rarely. However, if the provider’s certificate does change, any attempt to assume an IAM role that specifies the OIDC provider as a principal fails until the certificate thumbprint is updated.
Note
Because trust for the OIDC provider is ultimately derived from the provider’s certificate and is validated by the thumbprint, it is a best practice to limit access to the UpdateOpenIDConnectProviderThumbprint action to highly-privileged users.
See also: AWS API Documentation
Request Syntax
response = client.update_open_id_connect_provider_thumbprint(
OpenIDConnectProviderArn='string',
ThumbprintList=[
'string',
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_role_description(**kwargs)¶Modifies the description of a role.
See also: AWS API Documentation
Request Syntax
response = client.update_role_description(
RoleName='string',
Description='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
}
}
Response Structure
|
update_saml_provider(**kwargs)¶Updates the metadata document for an existing SAML provider resource object.
Note
This operation requires Signature Version 4 .
See also: AWS API Documentation
Request Syntax
response = client.update_saml_provider(
SAMLMetadataDocument='string',
SAMLProviderArn='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SAMLProviderArn': 'string'
}
Response Structure
|
update_server_certificate(**kwargs)¶Updates the name and/or the path of the specified server certificate stored in IAM.
For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide .
Warning
You should understand the implications of changing a server certificate’s path or name. For more information, see Renaming a Server Certificate in the IAM User Guide .
Note
To change a server certificate name the requester must have appropriate permissions on both the source object and the target object. For example, to change the name from “ProductionCert” to “ProdCert”, the entity making the request must have permission on “ProductionCert” and “ProdCert”, or must have permission on all (*). For more information about permissions, see Access Management in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_server_certificate(
ServerCertificateName='string',
NewPath='string',
NewServerCertificateName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_service_specific_credential(**kwargs)¶Sets the status of a service-specific credential to Active or Inactive . Service-specific credentials that are inactive cannot be used for authentication to the service. This action can be used to disable a user’s service-specific credential as part of a credential rotation work flow.
See also: AWS API Documentation
Request Syntax
response = client.update_service_specific_credential(
UserName='string',
ServiceSpecificCredentialId='string',
Status='Active'|'Inactive'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_signing_certificate(**kwargs)¶Changes the status of the specified user signing certificate from active to disabled, or vice versa. This action can be used to disable an IAM 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, you can use this action to manage root credentials even if the AWS account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.update_signing_certificate(
UserName='string',
CertificateId='string',
Status='Active'|'Inactive'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command changes the status of a signing certificate for a user named Bob to Inactive.
response = client.update_signing_certificate(
CertificateId='TA7SMP42TDN5Z26OBPJE7EXAMPLE',
Status='Inactive',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_ssh_public_key(**kwargs)¶Sets the status of an IAM user’s SSH public key to active or inactive. SSH public keys that are inactive cannot be used for authentication. This action can be used to disable a user’s SSH public key as part of a key rotation work flow.
The SSH public key affected by this action is used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections in the AWS CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_ssh_public_key(
UserName='string',
SSHPublicKeyId='string',
Status='Active'|'Inactive'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_user(**kwargs)¶Updates the name and/or the path of the specified IAM user.
Warning
You should understand the implications of changing an IAM user’s path or name. For more information, see Renaming an IAM User and Renaming an IAM Group in the IAM User Guide .
Note
To change a user name the requester must have appropriate permissions on both the source object and the target object. For example, to change Bob to Robert, the entity making the request must have permission on Bob and Robert, or must have permission on all (*). For more information about permissions, see Permissions and Policies .
See also: AWS API Documentation
Request Syntax
response = client.update_user(
UserName='string',
NewPath='string',
NewUserName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
The following command changes the name of the IAM user Bob to Robert. It does not change the user’s path.
response = client.update_user(
NewUserName='Robert',
UserName='Bob',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
upload_server_certificate(**kwargs)¶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.
We recommend that you use AWS Certificate Manager to provision, manage, and deploy your server certificates. With ACM you can request a certificate, deploy it to AWS resources, and let ACM handle certificate renewals for you. Certificates provided by ACM are free. For more information about using ACM, see the AWS Certificate Manager User Guide .
For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide .
For information about the number of server certificates you can upload, see Limitations on IAM Entities and Objects in the IAM User Guide .
Note
Because the body of the public key certificate, private key, and the certificate chain can be large, you should use POST rather than GET when calling UploadServerCertificate . For information about setting up signatures and authorization through the API, go to Signing AWS API Requests in the AWS General Reference . For general information about using the Query API with IAM, go to Calling the API by Making HTTP Query Requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.upload_server_certificate(
Path='string',
ServerCertificateName='string',
CertificateBody='string',
PrivateKey='string',
CertificateChain='string'
)
| Parameters: |
|
|---|---|
| Return type: | 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
|
Examples
The following upload-server-certificate command uploads a server certificate to your AWS account:
response = client.upload_server_certificate(
CertificateBody='-----BEGIN CERTIFICATE-----<a very long certificate text string>-----END CERTIFICATE-----',
Path='/company/servercerts/',
PrivateKey='-----BEGIN DSA PRIVATE KEY-----<a very long private key string>-----END DSA PRIVATE KEY-----',
ServerCertificateName='ProdServerCert',
)
print(response)
Expected Output:
{
'ServerCertificateMetadata': {
'Arn': 'arn:aws:iam::123456789012:server-certificate/company/servercerts/ProdServerCert',
'Expiration': datetime(2012, 5, 8, 1, 2, 3, 1, 129, 0),
'Path': '/company/servercerts/',
'ServerCertificateId': 'ASCA1111111111EXAMPLE',
'ServerCertificateName': 'ProdServerCert',
'UploadDate': datetime(2010, 5, 8, 1, 2, 3, 5, 128, 0),
},
'ResponseMetadata': {
'...': '...',
},
}
upload_signing_certificate(**kwargs)¶Uploads an X.509 signing certificate and associates it with the specified IAM 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 IAM 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, you can use this action to manage root credentials even if the AWS account has no associated users.
Note
Because the body of a X.509 certificate can be large, you should use POST rather than GET when calling UploadSigningCertificate . For information about setting up signatures and authorization through the API, go to Signing AWS API Requests in the AWS General Reference . For general information about using the Query API with IAM, go to Making Query Requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.upload_signing_certificate(
UserName='string',
CertificateBody='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Certificate': {
'UserName': 'string',
'CertificateId': 'string',
'CertificateBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
|
Examples
The following command uploads a signing certificate for the IAM user named Bob.
response = client.upload_signing_certificate(
CertificateBody='-----BEGIN CERTIFICATE-----<certificate-body>-----END CERTIFICATE-----',
UserName='Bob',
)
print(response)
Expected Output:
{
'Certificate': {
'CertificateBody': '-----BEGIN CERTIFICATE-----<certificate-body>-----END CERTIFICATE-----',
'CertificateId': 'ID123456789012345EXAMPLE',
'Status': 'Active',
'UploadDate': datetime(2015, 6, 6, 21, 40, 8, 5, 157, 0),
'UserName': 'Bob',
},
'ResponseMetadata': {
'...': '...',
},
}
upload_ssh_public_key(**kwargs)¶Uploads an SSH public key and associates it with the specified IAM user.
The SSH public key uploaded by this action can be used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections in the AWS CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.upload_ssh_public_key(
UserName='string',
SSHPublicKeyBody='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SSHPublicKey': {
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Fingerprint': 'string',
'SSHPublicKeyBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
|
The available paginators are:
IAM.Paginator.GetAccountAuthorizationDetailsIAM.Paginator.GetGroupIAM.Paginator.ListAccessKeysIAM.Paginator.ListAccountAliasesIAM.Paginator.ListAttachedGroupPoliciesIAM.Paginator.ListAttachedRolePoliciesIAM.Paginator.ListAttachedUserPoliciesIAM.Paginator.ListEntitiesForPolicyIAM.Paginator.ListGroupPoliciesIAM.Paginator.ListGroupsIAM.Paginator.ListGroupsForUserIAM.Paginator.ListInstanceProfilesIAM.Paginator.ListInstanceProfilesForRoleIAM.Paginator.ListMFADevicesIAM.Paginator.ListPoliciesIAM.Paginator.ListPolicyVersionsIAM.Paginator.ListRolePoliciesIAM.Paginator.ListRolesIAM.Paginator.ListSSHPublicKeysIAM.Paginator.ListServerCertificatesIAM.Paginator.ListSigningCertificatesIAM.Paginator.ListUserPoliciesIAM.Paginator.ListUsersIAM.Paginator.ListVirtualMFADevicesIAM.Paginator.SimulateCustomPolicyIAM.Paginator.SimulatePrincipalPolicyIAM.Paginator.GetAccountAuthorizationDetails¶paginator = client.get_paginator('get_account_authorization_details')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.get_account_authorization_details().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filter=[
'User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'UserDetailList': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'UserPolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'GroupList': [
'string',
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'GroupDetailList': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'GroupPolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'RoleDetailList': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'InstanceProfileList': [
{
'Path': 'string',
'InstanceProfileName': 'string',
'InstanceProfileId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
},
]
},
],
'RolePolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
]
},
],
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'PolicyVersionList': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.GetGroup¶paginator = client.get_paginator('get_group')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.get_group().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
GroupName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | 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),
'PasswordLastUsed': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListAccessKeys¶paginator = client.get_paginator('list_access_keys')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_access_keys().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AccessKeyMetadata': [
{
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListAccountAliases¶paginator = client.get_paginator('list_account_aliases')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_account_aliases().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: | PaginationConfig (dict) – A dictionary that provides parameters to control pagination.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'AccountAliases': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListAttachedGroupPolicies¶paginator = client.get_paginator('list_attached_group_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_attached_group_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
GroupName='string',
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListAttachedRolePolicies¶paginator = client.get_paginator('list_attached_role_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_attached_role_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
RoleName='string',
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListAttachedUserPolicies¶paginator = client.get_paginator('list_attached_user_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_attached_user_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListEntitiesForPolicy¶paginator = client.get_paginator('list_entities_for_policy')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_entities_for_policy().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PolicyArn='string',
EntityFilter='User'|'Role'|'Group'|'LocalManagedPolicy'|'AWSManagedPolicy',
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'PolicyUsers': [
{
'UserName': 'string',
'UserId': 'string'
},
],
'PolicyRoles': [
{
'RoleName': 'string',
'RoleId': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListGroupPolicies¶paginator = client.get_paginator('list_group_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_group_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
GroupName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListGroups¶paginator = client.get_paginator('list_groups')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_groups().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListGroupsForUser¶paginator = client.get_paginator('list_groups_for_user')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_groups_for_user().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListInstanceProfiles¶paginator = client.get_paginator('list_instance_profiles')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_instance_profiles().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListInstanceProfilesForRole¶paginator = client.get_paginator('list_instance_profiles_for_role')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_instance_profiles_for_role().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
RoleName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | 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',
'Description': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListMFADevices¶paginator = client.get_paginator('list_mfa_devices')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_mfa_devices().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MFADevices': [
{
'UserName': 'string',
'SerialNumber': 'string',
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListPolicies¶paginator = client.get_paginator('list_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Scope='All'|'AWS'|'Local',
OnlyAttached=True|False,
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListPolicyVersions¶paginator = client.get_paginator('list_policy_versions')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_policy_versions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PolicyArn='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Versions': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListRolePolicies¶paginator = client.get_paginator('list_role_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_role_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
RoleName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListRoles¶paginator = client.get_paginator('list_roles')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_roles().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListSSHPublicKeys¶paginator = client.get_paginator('list_ssh_public_keys')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_ssh_public_keys().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'SSHPublicKeys': [
{
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListServerCertificates¶paginator = client.get_paginator('list_server_certificates')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_server_certificates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | 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,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListSigningCertificates¶paginator = client.get_paginator('list_signing_certificates')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_signing_certificates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Certificates': [
{
'UserName': 'string',
'CertificateId': 'string',
'CertificateBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListUserPolicies¶paginator = client.get_paginator('list_user_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_user_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListUsers¶paginator = client.get_paginator('list_users')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_users().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PathPrefix='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Users': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.ListVirtualMFADevices¶paginator = client.get_paginator('list_virtual_mfa_devices')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_virtual_mfa_devices().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AssignmentStatus='Assigned'|'Unassigned'|'Any',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | 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),
'PasswordLastUsed': datetime(2015, 1, 1)
},
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.SimulateCustomPolicy¶paginator = client.get_paginator('simulate_custom_policy')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.simulate_custom_policy().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PolicyInputList=[
'string',
],
ActionNames=[
'string',
],
ResourceArns=[
'string',
],
ResourcePolicy='string',
ResourceOwner='string',
CallerArn='string',
ContextEntries=[
{
'ContextKeyName': 'string',
'ContextKeyValues': [
'string',
],
'ContextKeyType': 'string'|'stringList'|'numeric'|'numericList'|'boolean'|'booleanList'|'ip'|'ipList'|'binary'|'binaryList'|'date'|'dateList'
},
],
ResourceHandlingOption='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationResults': [
{
'EvalActionName': 'string',
'EvalResourceName': 'string',
'EvalDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'OrganizationsDecisionDetail': {
'AllowedByOrganizations': True|False
},
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
},
'ResourceSpecificResults': [
{
'EvalResourceName': 'string',
'EvalResourceDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
}
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
IAM.Paginator.SimulatePrincipalPolicy¶paginator = client.get_paginator('simulate_principal_policy')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.simulate_principal_policy().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PolicySourceArn='string',
PolicyInputList=[
'string',
],
ActionNames=[
'string',
],
ResourceArns=[
'string',
],
ResourcePolicy='string',
ResourceOwner='string',
CallerArn='string',
ContextEntries=[
{
'ContextKeyName': 'string',
'ContextKeyValues': [
'string',
],
'ContextKeyType': 'string'|'stringList'|'numeric'|'numericList'|'boolean'|'booleanList'|'ip'|'ipList'|'binary'|'binaryList'|'date'|'dateList'
},
],
ResourceHandlingOption='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationResults': [
{
'EvalActionName': 'string',
'EvalResourceName': 'string',
'EvalDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'OrganizationsDecisionDetail': {
'AllowedByOrganizations': True|False
},
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
},
'ResourceSpecificResults': [
{
'EvalResourceName': 'string',
'EvalResourceDecision': 'allowed'|'explicitDeny'|'implicitDeny',
'MatchedStatements': [
{
'SourcePolicyId': 'string',
'SourcePolicyType': 'user'|'group'|'role'|'aws-managed'|'user-managed'|'resource'|'none',
'StartPosition': {
'Line': 123,
'Column': 123
},
'EndPosition': {
'Line': 123,
'Column': 123
}
},
],
'MissingContextValues': [
'string',
],
'EvalDecisionDetails': {
'string': 'allowed'|'explicitDeny'|'implicitDeny'
}
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
|
The available waiters are:
IAM.Waiter.InstanceProfileExists¶waiter = client.get_waiter('instance_profile_exists')
wait(**kwargs)¶Polls IAM.Client.get_instance_profile() every 1 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
InstanceProfileName='string'
)
| Parameters: | InstanceProfileName (string) – [REQUIRED] The name of the instance profile to get information about. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |
IAM.Waiter.UserExists¶waiter = client.get_waiter('user_exists')
wait(**kwargs)¶Polls IAM.Client.get_user() every 1 seconds until a successful state is reached. An error is returned after 20 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
UserName='string'
)
| Parameters: | UserName (string) – The 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. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@- |
|---|---|
| Returns: | None |