Table of Contents
A low-level client representing AWS Identity and Access Management (IAM)
Identity and Access Management (IAM) is a web service for securely controlling access to Amazon Web Services services. With IAM, you can centrally manage users, security credentials such as access keys, and permissions that control which Amazon Web Services resources users and applications can access. For more information about IAM, see Identity and Access Management (IAM) and the Identity and Access Management User Guide .
import boto3
client = boto3.client('iam')
These are the available methods:
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 operation 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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM OpenID Connect (OIDC) provider resource to add the client ID to. You can get a list of OIDC provider ARNs by using the ListOpenIDConnectProviders operation.
[REQUIRED]
The client ID (also known as audience) to add to the IAM OpenID Connect provider resource.
None
Exceptions
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': {
'...': '...',
},
}
Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role, and this quota cannot be increased. You can remove the existing role and then add a different role to an instance profile. You must then wait for the change to appear across all of Amazon Web Services because of eventual consistency . To force the change, you must disassociate the instance profile and then associate the instance profile , or you can stop your instance and then restart it.
Note
The caller of this operation must be granted the PassRole permission on the IAM role by a permissions policy.
For more information about roles, see Working with roles . For more information about instance profiles, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = client.add_role_to_instance_profile(
InstanceProfileName='string',
RoleName='string'
)
[REQUIRED]
The name of the instance profile to update.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the role to add.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
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'
)
[REQUIRED]
The name of the group to update.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the user to add.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
Attaches the specified managed policy to the specified IAM group.
You use this operation to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
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'
)
[REQUIRED]
The name (friendly name, not ARN) of the group to attach the policy to.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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': {
'...': '...',
},
}
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 operation 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 .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_role_policy(
RoleName='string',
PolicyArn='string'
)
[REQUIRED]
The name (friendly name, not ARN) of the role to attach the policy to.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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': {
'...': '...',
},
}
Attaches the specified managed policy to the specified user.
You use this operation to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
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'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user to attach the policy to.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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': {
'...': '...',
},
}
Check if an operation can be paginated.
Changes the password of the IAM user who is calling this operation. This operation can be performed using the CLI, the Amazon Web Services API, or the My Security Credentials page in the Management Console. The account root user password is not affected by this operation.
Use UpdateLoginProfile to use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. 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'
)
[REQUIRED]
The IAM user's current password.
[REQUIRED]
The new password. The new password must conform to the account's password policy, if one exists.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020 ) through the end of the ASCII character range (\u00FF ). You can also include the tab (\u0009 ), line feed (\u000A ), and carriage return (\u000D ) characters. Any of these characters are valid in a password. However, many tools, such as the Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.
None
Exceptions
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': {
'...': '...',
},
}
Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services 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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials. This is true even if the account has no associated users.
For information about quotas on the number of keys you can create, see IAM and STS quotas in the IAM User Guide .
Warning
To ensure the security of your 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'
)
The name of the IAM user that the new key will belong to.
This parameter allows (through 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: _+=,.@-
{
'AccessKey': {
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'SecretAccessKey': 'string',
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
Contains the response to a successful CreateAccessKey request.
A structure with details about the access key.
The name of the IAM user that the access key is associated with.
The ID for this access key.
The status of the access key. Active means that the key is valid for API calls, while Inactive means it is not.
The secret key used to sign requests.
The date when the access key was created.
Exceptions
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': {
'...': '...',
},
}
Creates an alias for your account. For information about using an account alias, see Using an alias for your account ID in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_account_alias(
AccountAlias='string'
)
[REQUIRED]
The account alias to create.
This parameter allows (through 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.
Exceptions
Examples
The following command associates the alias examplecorp to your AWS account.
response = client.create_account_alias(
AccountAlias='examplecorp',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a new group.
For information about the number of groups you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_group(
Path='string',
GroupName='string'
)
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the group to create. Do not include the path in this value.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
dict
Response Syntax
{
'Group': {
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful CreateGroup request.
Group (dict) --
A structure containing details about the new group.
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
Exceptions
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': {
'...': '...',
},
}
Creates a new instance profile. For information about instance profiles, see Using roles for applications on Amazon EC2 in the IAM User Guide , and Instance profiles in the Amazon EC2 User Guide .
For information about the number of instance profiles you can create, see IAM object quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_instance_profile(
InstanceProfileName='string',
Path='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the instance profile to create.
This parameter allows (through 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: _+=,.@-
The path to the instance profile. For more information about paths, see IAM Identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A list of tags that you want to attach to the newly created IAM instance profile. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the response to a successful CreateInstanceProfile request.
InstanceProfile (dict) --
A structure containing details about the new instance profile.
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Creates a password for the specified IAM user. A password allows an IAM user to access Amazon Web Services services through the Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to create a password for any IAM user. Use ChangePassword to update your own existing password in the My Security Credentials page in the 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
)
[REQUIRED]
The name of the IAM user to create a password for. The user must already exist.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The new password for the user.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020 ) through the end of the ASCII character range (\u00FF ). You can also include the tab (\u0009 ), line feed (\u000A ), and carriage return (\u000D ) characters. Any of these characters are valid in a password. However, many tools, such as the Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.
dict
Response Syntax
{
'LoginProfile': {
'UserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordResetRequired': True|False
}
}
Response Structure
(dict) --
Contains the response to a successful CreateLoginProfile request.
LoginProfile (dict) --
A structure containing the user name and password create date.
UserName (string) --
The name of the user, which can be used for signing in to the Management Console.
CreateDate (datetime) --
The date when the password for the user was created.
PasswordResetRequired (boolean) --
Specifies whether the user is required to set a new password on next sign-in.
Exceptions
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': {
'...': '...',
},
}
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. Such a policy establishes a trust relationship between Amazon Web Services and the OIDC provider.
If you are using an OIDC identity provider from Google, Facebook, or Amazon Cognito, you don't need to create a separate IAM identity provider. These OIDC identity providers are already built-in to Amazon Web Services and are available for your use. Instead, you can move directly to creating new roles using your identity provider. To learn more, see Creating a role for web identity or OpenID connect federation in the IAM User Guide .
When you create the IAM OIDC provider, you specify the following:
You get all of this information from the OIDC IdP that you want to use to access Amazon Web Services.
Note
The trust for the OIDC provider is derived from the IAM provider that this operation creates. Therefore, it is best to limit access to the CreateOpenIDConnectProvider operation to highly privileged users.
See also: AWS API Documentation
Request Syntax
response = client.create_open_id_connect_provider(
Url='string',
ClientIDList=[
'string',
],
ThumbprintList=[
'string',
],
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The URL of the identity provider. The URL must begin with https:// and should correspond to the iss claim in the provider's OpenID Connect ID tokens. Per the OIDC standard, path components are allowed but query parameters are not. Typically the URL consists of only a hostname, like https://server.example.org or https://example.com .
You cannot register the same provider multiple times in a single account. If you try to submit a URL that has already been used for an OpenID Connect provider in the account, you will get an error.
A list of client IDs (also known as audiences). When a mobile or web app registers with an OpenID Connect provider, they establish a value that identifies the application. (This is the value that's sent as the client_id parameter on OAuth requests.)
You can register multiple client IDs with the same provider. For example, you might have multiple applications that use the same OIDC provider. You cannot register more than 100 client IDs with a single IAM OIDC provider.
There is no defined format for a client ID. The CreateOpenIDConnectProviderRequest operation accepts client IDs up to 255 characters long.
[REQUIRED]
A list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificates. Typically this list includes only one entry. However, IAM lets you have up to five thumbprints for an OIDC provider. This lets you maintain multiple thumbprints if the identity provider is rotating certificates.
The server certificate thumbprint is the hex-encoded SHA-1 hash value of the X.509 certificate used by the domain where the OpenID Connect provider makes its keys available. It is always a 40-character string.
You must provide at least one thumbprint when creating an IAM OIDC provider. For example, assume that the OIDC provider is server.example.com and the provider stores its keys at https://keys.server.example.com/openid-connect. In that case, the thumbprint string would be the hex-encoded SHA-1 hash value of the certificate used by https://keys.server.example.com.
For more information about obtaining the OIDC provider's thumbprint, see Obtaining the thumbprint for an OpenID Connect provider in the IAM User Guide .
Contains a thumbprint for an identity provider's server certificate.
The identity provider's server certificate thumbprint is the hex-encoded SHA-1 hash value of the self-signed X.509 certificate. This thumbprint is used by the domain where the OpenID Connect provider makes its keys available. The thumbprint is always a 40-character string.
A list of tags that you want to attach to the new IAM OpenID Connect (OIDC) provider. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'OpenIDConnectProviderArn': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
(dict) --
Contains the response to a successful CreateOpenIDConnectProvider request.
OpenIDConnectProviderArn (string) --
The Amazon Resource Name (ARN) of the new IAM OpenID Connect provider that is created. For more information, see OpenIDConnectProviderListEntry .
Tags (list) --
A list of tags that are attached to the new IAM OIDC provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Creates a new managed policy for your 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 .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM 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',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The friendly name of the policy.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
The path for the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The JSON policy document that you want to use as the content for the new policy.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
A friendly description of the policy.
Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables."
The policy description is immutable. After a value is assigned, it cannot be changed.
A list of tags that you want to attach to the new IAM customer managed policy. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'Policy': {
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the response to a successful CreatePolicy request.
Policy (dict) --
A structure containing details about the new policy.
PolicyName (string) --
The friendly name (not ARN) identifying the policy.
PolicyId (string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Path (string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
DefaultVersionId (string) --
The identifier for the version of the policy that is set as the default version.
AttachmentCount (integer) --
The number of entities (users, groups, and roles) that the policy is attached to.
PermissionsBoundaryUsageCount (integer) --
The number of entities (users and roles) for which the policy is used to set the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
IsAttachable (boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
Description (string) --
A friendly description of the policy.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
UpdateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
[REQUIRED]
The JSON policy document that you want to use as the content for this new version of the policy.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Specifies whether to set this version as the policy's default version.
When this parameter is true , the new policy version becomes the operative version. That is, it becomes the version that is in effect for the IAM users, groups, and roles that the policy is attached to.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
dict
Response Syntax
{
'PolicyVersion': {
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful CreatePolicyVersion request.
PolicyVersion (dict) --
A structure containing details about the new policy version.
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
Exceptions
Creates a new role for your account. For more information about roles, see IAM roles . For information about quotas for role names and the number of roles you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_role(
Path='string',
RoleName='string',
AssumeRolePolicyDocument='string',
Description='string',
MaxSessionDuration=123,
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the role to create.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
[REQUIRED]
The trust relationship policy document that grants an entity permission to assume the role.
In IAM, you must provide a JSON policy that has been converted to a string. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Upon success, the response includes the same trust policy in JSON format.
The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours.
Anyone who assumes the role from the or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide .
A list of tags that you want to attach to the new role. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
}
}
Response Structure
(dict) --
Contains the response to a successful CreateRole request.
Role (dict) --
A structure containing details about the new role.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Exceptions
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': {
'...': '...',
},
}
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. Such a policy can 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 Management Console or one that supports API access to Amazon Web Services.
When you create the SAML provider resource, you upload a SAML metadata document that you get from your IdP. That document 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 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',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.
For more information, see About SAML 2.0-based federation in the IAM User Guide
[REQUIRED]
The name of the provider to create.
This parameter allows (through 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: _+=,.@-
A list of tags that you want to attach to the new IAM SAML provider. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'SAMLProviderArn': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
(dict) --
Contains the response to a successful CreateSAMLProvider request.
SAMLProviderArn (string) --
The Amazon Resource Name (ARN) of the new SAML provider resource in IAM.
Tags (list) --
A list of tags that are attached to the new IAM SAML provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
Creates an IAM role that is linked to a specific Amazon Web Services 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 Amazon Web Services 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. For more information, see Using service-linked roles in the IAM User Guide .
To attach a policy to this service-linked role, you must make the request using the Amazon Web Services 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'
)
[REQUIRED]
The service principal for the Amazon Web Services service to which this role is attached. You use a string similar to a URL but without the http:// in front. For example: elasticbeanstalk.amazonaws.com .
Service principals are unique and case-sensitive. To find the exact service principal for your service-linked role, see Amazon Web Services services that work with IAM in the IAM User Guide . Look for the services that have Yes in the Service-Linked Role column. Choose the Yes link to view the service-linked role documentation for that service.
A string that you provide, which is combined with the service-provided prefix to form the complete role name. If you make multiple requests for the same service, then you must supply a different CustomSuffix for each request. Otherwise the request fails with a duplicate role name error. For example, you could add -1 or -debug to the suffix.
Some services do not support the CustomSuffix parameter. If you provide an optional suffix and the operation fails, try the operation again without the suffix.
dict
Response Syntax
{
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
}
}
Response Structure
(dict) --
Role (dict) --
A Role object that contains details about the newly created role.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Exceptions
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.
You can create service-specific credentials for CodeCommit and Amazon Keyspaces (for Apache Cassandra).
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 CodeCommit: Git credentials, SSH keys, and Amazon Web Services access keys in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_service_specific_credential(
UserName='string',
ServiceName='string'
)
[REQUIRED]
The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the Amazon Web Services service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.
dict
Response Syntax
{
'ServiceSpecificCredential': {
'CreateDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'ServiceUserName': 'string',
'ServicePassword': 'string',
'ServiceSpecificCredentialId': 'string',
'UserName': 'string',
'Status': 'Active'|'Inactive'
}
}
Response Structure
(dict) --
ServiceSpecificCredential (dict) --
A structure that contains information about the newly created service-specific credential.
Warning
This is the only time that the password for this credential set is available. It cannot be recovered later. Instead, you must reset the password with ResetServiceSpecificCredential .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the service-specific credential were created.
ServiceName (string) --
The name of the service associated with the service-specific credential.
ServiceUserName (string) --
The generated user name for the service-specific credential. This value is generated by combining the IAM user's name combined with the ID number of the Amazon Web Services account, as in jane-at-123456789012 , for example. This value cannot be configured by the user.
ServicePassword (string) --
The generated password for the service-specific credential.
ServiceSpecificCredentialId (string) --
The unique identifier for the service-specific credential.
UserName (string) --
The name of the IAM user associated with the service-specific credential.
Status (string) --
The status of the service-specific credential. Active means that the key is valid for API calls, while Inactive means it is not.
Exceptions
Creates a new IAM user for your account.
For information about quotas for the number of IAM users you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_user(
Path='string',
UserName='string',
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the user name. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the user to create.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
A list of tags that you want to attach to the new user. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'User': {
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the response to a successful CreateUser request.
User (dict) --
A structure with details about the new IAM user.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Creates a new virtual MFA device for the 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, see Using a virtual MFA device in the IAM User Guide .
For information about the maximum number of MFA devices you can create, see IAM and STS quotas 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. In other words, protect the seed information as you would your Amazon Web Services 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',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the virtual MFA device. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
This parameter allows (through 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: _+=,.@-
A list of tags that you want to attach to the new IAM virtual MFA device. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
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),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'EnableDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the response to a successful CreateVirtualMFADevice request.
VirtualMFADevice (dict) --
A structure containing details about the new virtual MFA device.
SerialNumber (string) --
The serial number associated with VirtualMFADevice .
Base32StringSeed (bytes) --
The base32 seed defined as specified in RFC3548 . The Base32StringSeed is base64-encoded.
QRCodePNG (bytes) --
A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String where $virtualMFADeviceName is one of the create call arguments. AccountName is the user name if set (otherwise, the account ID otherwise), and Base32String is the seed in base32 format. The Base32String value is base64-encoded.
User (dict) --
The IAM user associated with this virtual MFA device.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
EnableDate (datetime) --
The date and time on which the virtual MFA device was enabled.
Tags (list) --
A list of tags that are attached to the virtual MFA device. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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, see Enabling a virtual multi-factor authentication (MFA) device in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.deactivate_mfa_device(
UserName='string',
SerialNumber='string'
)
[REQUIRED]
The name of the user whose MFA device you want to deactivate.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.
This parameter allows (through 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: =,.@:/-
None
Exceptions
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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.delete_access_key(
UserName='string',
AccessKeyId='string'
)
The name of the user whose access key pair you want to delete.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The access key ID for the access key ID and secret access key you want to delete.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
None
Exceptions
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': {
'...': '...',
},
}
Deletes the specified account alias. For information about using an Amazon Web Services account alias, see Using an alias for your account ID in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_account_alias(
AccountAlias='string'
)
[REQUIRED]
The name of the account alias to delete.
This parameter allows (through 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.
Exceptions
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': {
'...': '...',
},
}
Deletes the password policy for the account. There are no parameters.
See also: AWS API Documentation
Request Syntax
response = client.delete_account_password_policy()
Exceptions
Examples
The following command removes the password policy from the current AWS account:
response = client.delete_account_password_policy(
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
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'
)
[REQUIRED]
The name of the IAM group to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
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'
)
[REQUIRED]
The name (friendly name, not ARN) identifying the group that the policy is embedded in.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name identifying the policy document to delete.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
Deletes the specified instance profile. The instance profile must not have an associated role.
Warning
Make sure that 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, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = client.delete_instance_profile(
InstanceProfileName='string'
)
[REQUIRED]
The name of the instance profile to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
Examples
The following command deletes the instance profile named ExampleInstanceProfile
response = client.delete_instance_profile(
InstanceProfileName='ExampleInstanceProfile',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the password for the specified IAM user, which terminates the user's ability to access Amazon Web Services services through the Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to delete a password for any IAM user. You can use ChangePassword to update, but not delete, your own password in the My Security Credentials page in the Management Console.
Warning
Deleting a user's password does not prevent a user from accessing Amazon Web Services 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'
)
[REQUIRED]
The name of the user whose password you want to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
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': {
'...': '...',
},
}
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 operation is idempotent; it does not fail or return an error if you call the operation for a provider that does not exist.
See also: AWS API Documentation
Request Syntax
response = client.delete_open_id_connect_provider(
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 operation.
Exceptions
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. In addition, you must delete all 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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to delete.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Exceptions
Deletes the specified version from the specified managed policy.
You cannot delete the default version from a policy using this operation. 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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
[REQUIRED]
The policy version to delete.
This parameter allows (through its regex pattern ) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
None
Exceptions
Deletes the specified role. The role must not have any policies attached. For more information about roles, see Working with roles .
Warning
Make sure that 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'
)
[REQUIRED]
The name of the role to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
Examples
The following command removes the role named Test-Role.
response = client.delete_role(
RoleName='Test-Role',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the permissions boundary for the specified IAM role.
Warning
Deleting the permissions boundary for a role might increase its permissions. For example, it might allow anyone who assumes the role to perform all the actions granted in its permissions policies.
See also: AWS API Documentation
Request Syntax
response = client.delete_role_permissions_boundary(
RoleName='string'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM role from which you want to remove the permissions boundary.
Exceptions
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'
)
[REQUIRED]
The name (friendly name, not ARN) identifying the role that the policy is embedded in.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the inline policy to delete from the specified IAM role.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the SAML provider to delete.
Exceptions
Deletes the specified server certificate.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic also includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
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, see DeleteLoadBalancerListeners in the Elastic Load Balancing API Reference .
See also: AWS API Documentation
Request Syntax
response = client.delete_server_certificate(
ServerCertificateName='string'
)
[REQUIRED]
The name of the server certificate you want to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
Submits a service-linked role deletion request and returns a DeletionTaskId , which you can use to check the status of the deletion. Before you call this operation, confirm that the role has no active sessions and that any resources used by the role in the linked service are deleted. If you call this operation more than once for the same service-linked role and an earlier deletion task is not complete, then the DeletionTaskId of the earlier request is returned.
If you submit a deletion request for a service-linked role whose linked service is still accessing a resource, then the deletion task fails. If it fails, the GetServiceLinkedRoleDeletionStatus operation returns the reason for the failure, usually including the resources that must be deleted. To delete the service-linked role, you must first remove those resources from the linked service and then submit the deletion request again. Resources are specific to the service that is linked to the role. For more information about removing resources from a service, see the Amazon Web Services documentation for your service.
For more information about service-linked roles, see Roles terms and concepts: Amazon Web Services service-linked role in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_service_linked_role(
RoleName='string'
)
[REQUIRED]
The name of the service-linked role to be deleted.
{
'DeletionTaskId': 'string'
}
Response Structure
The deletion task identifier that you can use to check the status of the deletion. This identifier is returned in the format task/aws-service-role/<service-principal-name>/<role-name>/<task-uuid> .
Exceptions
Deletes the specified service-specific credential.
See also: AWS API Documentation
Request Syntax
response = client.delete_service_specific_credential(
UserName='string',
ServiceSpecificCredentialId='string'
)
The name of the IAM user associated with the service-specific credential. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier of the service-specific credential. You can get this value by calling ListServiceSpecificCredentials .
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
None
Exceptions
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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated IAM users.
See also: AWS API Documentation
Request Syntax
response = client.delete_signing_certificate(
UserName='string',
CertificateId='string'
)
The name of the user the signing certificate belongs to.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The ID of the signing certificate to delete.
The format of this parameter, as described by its regex pattern, is a string of characters that can be upper- or lower-cased letters or digits.
None
Exceptions
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': {
'...': '...',
},
}
Deletes the specified SSH public key.
The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_ssh_public_key(
UserName='string',
SSHPublicKeyId='string'
)
[REQUIRED]
The name of the IAM user associated with the SSH public key.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier for the SSH public key.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
None
Exceptions
Deletes the specified IAM user. Unlike the Management Console, when you delete a user programmatically, you must delete the items attached to the user manually, or the deletion fails. For more information, see Deleting an IAM user . Before attempting to delete a user, remove the following items:
See also: AWS API Documentation
Request Syntax
response = client.delete_user(
UserName='string'
)
[REQUIRED]
The name of the user to delete.
This parameter allows (through 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: _+=,.@-
Exceptions
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': {
'...': '...',
},
}
Deletes the permissions boundary for the specified IAM user.
Warning
Deleting the permissions boundary for a user might increase its permissions by allowing the user to perform all the actions granted in its permissions policies.
See also: AWS API Documentation
Request Syntax
response = client.delete_user_permissions_boundary(
UserName='string'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user from which you want to remove the permissions boundary.
Exceptions
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'
)
[REQUIRED]
The name (friendly name, not ARN) identifying the user that the policy is embedded in.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name identifying the policy document to delete.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
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'
)
[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 (through 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: =,.@:/-
Exceptions
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': {
'...': '...',
},
}
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 DeleteGroupPolicy . 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'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM group to detach the policy from.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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 DeleteRolePolicy . 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'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM role to detach the policy from.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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 DeleteUserPolicy . 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'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user to detach the policy from.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
None
Exceptions
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'
)
[REQUIRED]
The name of the IAM user for whom you want to enable the MFA device.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.
This parameter allows (through 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: =,.@:/-
[REQUIRED]
An authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
[REQUIRED]
A subsequent authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
None
Exceptions
Generates a credential report for the 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()
{
'State': 'STARTED'|'INPROGRESS'|'COMPLETE',
'Description': 'string'
}
Response Structure
Contains the response to a successful GenerateCredentialReport request.
Information about the state of the credential report.
Information about the credential report.
Exceptions
Generates a report for service last accessed data for Organizations. You can generate a report for any entities (organization root, organizational unit, or account) or policies in your organization.
To call this operation, you must be signed in using your Organizations management account credentials. You can use your long-term IAM user or root user credentials, or temporary credentials from assuming an IAM role. SCPs must be enabled for your organization root. You must have the required IAM and Organizations permissions. For more information, see Refining permissions using service last accessed data in the IAM User Guide .
You can generate a service last accessed data report for entities by specifying only the entity's path. This data includes a list of services that are allowed by any service control policies (SCPs) that apply to the entity.
You can generate a service last accessed data report for a policy by specifying an entity's path and an optional Organizations policy ID. This data includes a list of services that are allowed by the specified SCP.
For each service in both report types, the data includes the most recent account activity that the policy allows to account principals in the entity or the entity's children. For important information about the data, reporting period, permissions required, troubleshooting, and supported Regions see Reducing permissions using service last accessed data in the IAM User Guide .
Warning
The data includes all attempts to access Amazon Web Services, not just the successful ones. This includes all attempts that were made using the Management Console, the Amazon Web Services API through any of the SDKs, or any of the command line tools. An unexpected entry in the service last accessed data does not mean that an account has been compromised, because the request might have been denied. Refer to your CloudTrail logs as the authoritative source for information about all API calls and whether they were successful or denied access. For more information, see Logging IAM events with CloudTrail in the IAM User Guide .
This operation returns a JobId . Use this parameter in the `` GetOrganizationsAccessReport `` operation to check the status of the report generation. To check the status of this request, use the JobId parameter in the `` GetOrganizationsAccessReport `` operation and test the JobStatus response parameter. When the job is complete, you can retrieve the report.
To generate a service last accessed data report for entities, specify an entity path without specifying the optional Organizations policy ID. The type of entity that you specify determines the data returned in the report.
To generate a service last accessed data report for policies, specify an entity path and the optional Organizations policy ID. The type of entity that you specify determines the data returned for each service.
Note
Service last accessed data does not use other policy types when determining whether a principal could access a service. These other policy types include identity-based policies, resource-based policies, access control lists, IAM permissions boundaries, and STS assume role policies. It only applies SCP logic. For more about the evaluation of policy types, see Evaluating policies in the IAM User Guide .
For more information about service last accessed data, see Reducing policy scope by viewing user activity in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.generate_organizations_access_report(
EntityPath='string',
OrganizationsPolicyId='string'
)
[REQUIRED]
The path of the Organizations entity (root, OU, or account). You can build an entity path using the known structure of your organization. For example, assume that your account ID is 123456789012 and its parent OU ID is ou-rge0-awsabcde . The organization root ID is r-f6g7h8i9j0example and your organization ID is o-a1b2c3d4e5 . Your entity path is o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-rge0-awsabcde/123456789012 .
The identifier of the Organizations service control policy (SCP). This parameter is optional.
This ID is used to generate information about when an account principal that is limited by the SCP attempted to access an Amazon Web Services service.
dict
Response Syntax
{
'JobId': 'string'
}
Response Structure
(dict) --
JobId (string) --
The job identifier that you can use in the GetOrganizationsAccessReport operation.
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Generates a report that includes details about when an IAM resource (user, group, role, or policy) was last used in an attempt to access Amazon Web Services services. Recent activity usually appears within four hours. IAM reports activity for the last 365 days, or less if your Region began supporting this feature within the last year. For more information, see Regions where data is tracked .
Warning
The service last accessed data includes all attempts to access an Amazon Web Services API, not just the successful ones. This includes all attempts that were made using the Management Console, the Amazon Web Services API through any of the SDKs, or any of the command line tools. An unexpected entry in the service last accessed data does not mean that your account has been compromised, because the request might have been denied. Refer to your CloudTrail logs as the authoritative source for information about all API calls and whether they were successful or denied access. For more information, see Logging IAM events with CloudTrail in the IAM User Guide .
The GenerateServiceLastAccessedDetails operation returns a JobId . Use this parameter in the following operations to retrieve the following details from your report:
To check the status of the GenerateServiceLastAccessedDetails request, use the JobId parameter in the same operations and test the JobStatus response parameter.
For additional information about the permissions policies that allow an identity (user, group, or role) to access specific services, use the ListPoliciesGrantingServiceAccess operation.
Note
Service last accessed data does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, Organizations policies, IAM permissions boundaries, and STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating policies in the IAM User Guide .
For more information about service and action last accessed data, see Reducing permissions using service last accessed data in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.generate_service_last_accessed_details(
Arn='string',
Granularity='SERVICE_LEVEL'|'ACTION_LEVEL'
)
[REQUIRED]
The ARN of the IAM resource (user, group, role, or managed policy) used to generate information about when the resource was last used in an attempt to access an Amazon Web Services service.
dict
Response Syntax
{
'JobId': 'string'
}
Response Structure
(dict) --
JobId (string) --
The JobId that you can use in the GetServiceLastAccessedDetails or GetServiceLastAccessedDetailsWithEntities operations. The JobId returned by GenerateServiceLastAccessedDetail must be used by the same role within a session, or by the same user when used to call GetServiceLastAccessedDetail .
Exceptions
Retrieves information about when the specified access key was last used. The information includes the date and time of last use, along with the Amazon Web Services 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'
)
[REQUIRED]
The identifier of an access key.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
{
'UserName': 'string',
'AccessKeyLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'Region': 'string'
}
}
Response Structure
Contains the response to a successful GetAccessKeyLastUsed request. It is also returned as a member of the AccessKeyMetaData structure returned by the ListAccessKeys action.
The name of the IAM user that owns this access key.
Contains information about the last time the access key was used.
The date and time, in ISO 8601 date-time format , when the access key was most recently used. This field is null in the following situations:
The name of the Amazon Web Services service with which this access key was most recently used. The value of this field is "N/A" in the following situations:
The Region where this access key was most recently used. The value for this field is "N/A" in the following situations:
For more information about Regions, see Regions and endpoints in the Amazon Web Services General Reference.
Exceptions
Retrieves information about all IAM users, groups, roles, and policies in your Amazon Web Services account, including their relationships to one another. Use this operation to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account.
Note
Policies returned by this operation 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.
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'
)
A list of entity types used to filter the results. Only the entities that match the types you specify are included in the output. Use the value LocalManagedPolicy to include customer managed policies.
The format for this parameter is a comma-separated (if more than one) list of strings. Each string value in the list must be one of the valid values listed below.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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'
},
],
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': '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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'RolePolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'PolicyVersionList': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetAccountAuthorizationDetails request.
UserDetailList (list) --
A list containing information about IAM users.
(dict) --
Contains information about an IAM user, including all the user's policies and all the IAM groups the user is in.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
UserPolicyList (list) --
A list of the inline policies embedded in the user.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
GroupList (list) --
A list of IAM groups that the user is in.
AttachedManagedPolicies (list) --
A list of the managed policies attached to the user.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the user.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
GroupDetailList (list) --
A list containing information about IAM groups.
(dict) --
Contains information about an IAM group, including all of the group's policies.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
GroupPolicyList (list) --
A list of the inline policies embedded in the group.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
AttachedManagedPolicies (list) --
A list of the managed policies attached to the group.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
RoleDetailList (list) --
A list containing information about IAM roles.
(dict) --
Contains information about an IAM role, including all of the role's policies.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The trust policy that grants permission to assume the role.
InstanceProfileList (list) --
A list of instance profiles that contain this role.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RolePolicyList (list) --
A list of inline policies embedded in the role. These policies are the role's access (permissions) policies.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
AttachedManagedPolicies (list) --
A list of managed policies attached to the role. These policies are the role's access (permissions) policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Policies (list) --
A list containing information about managed policies.
(dict) --
Contains information about a managed policy, including the policy's ARN, versions, and the number of principal entities (users, groups, and roles) that the policy is attached to.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
For more information about managed policies, see Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name (not ARN) identifying the policy.
PolicyId (string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Path (string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
DefaultVersionId (string) --
The identifier for the version of the policy that is set as the default (operative) version.
For more information about policy versions, see Versioning for managed policies in the IAM User Guide .
AttachmentCount (integer) --
The number of principal entities (users, groups, and roles) that the policy is attached to.
PermissionsBoundaryUsageCount (integer) --
The number of entities (users and roles) for which the policy is used as the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
IsAttachable (boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
Description (string) --
A friendly description of the policy.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
UpdateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
PolicyVersionList (list) --
A list containing information about the versions of the policy.
(dict) --
Contains information about a version of a managed policy.
This data type is used as a response element in the CreatePolicyVersion , GetPolicyVersion , ListPolicyVersions , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Retrieves the password policy for the account. This tells you the complexity requirements and mandatory rotation periods for the IAM user passwords in your account. For more information about using a password policy, see Managing an IAM password policy .
See also: AWS API Documentation
Request Syntax
response = client.get_account_password_policy()
{
'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
Contains the response to a successful GetAccountPasswordPolicy request.
A structure that contains details about the account's password policy.
Minimum length to require for IAM user passwords.
Specifies whether IAM user passwords must contain at least one of the following symbols:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
Specifies whether IAM user passwords must contain at least one uppercase character (A to Z).
Specifies whether IAM user passwords must contain at least one lowercase character (a to z).
Specifies whether IAM users are allowed to change their own password.
Indicates whether passwords in the account expire. Returns true if MaxPasswordAge contains a value greater than 0. Returns false if MaxPasswordAge is 0 or not present.
The number of days that an IAM user password is valid.
Specifies the number of previous passwords that IAM users are prevented from reusing.
Specifies whether IAM users are prevented from setting a new password after their password has expired.
Exceptions
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': {
'...': '...',
},
}
Retrieves information about IAM entity usage and IAM quotas in the Amazon Web Services account.
For information about IAM quotas, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_account_summary()
{
'SummaryMap': {
'string': 123
}
}
Response Structure
Contains the response to a successful GetAccountSummary request.
A set of key–value pairs containing information about IAM entity usage and IAM quotas.
Exceptions
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': {
'...': '...',
},
}
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 Amazon Web Services and its services that provide details about the context of an API query request. Context keys 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',
]
)
[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 the following:
{
'ContextKeyNames': [
'string',
]
}
Response Structure
Contains the response to a successful GetContextKeysForPrincipalPolicy or GetContextKeysForCustomPolicy request.
The list of context keys that are referenced in the input policies.
Exceptions
Gets a list of all of the context keys referenced in all the IAM policies that are 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 operation 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 Amazon Web Services and its services that provide details about the context of an API query request. Context keys 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',
]
)
[REQUIRED]
The ARN of a user, group, or role whose policies contain the context keys that you want listed. If you specify a user, the list includes context keys that are found in all policies that are attached to the user. The list also includes all groups that the user is a member of. If you pick a group or a role, then it includes only those context keys that are found in policies attached to that entity. 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.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
An optional list of additional policies for which you want the list of context keys that are referenced.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
dict
Response Syntax
{
'ContextKeyNames': [
'string',
]
}
Response Structure
(dict) --
Contains the response to a successful GetContextKeysForPrincipalPolicy or GetContextKeysForCustomPolicy request.
ContextKeyNames (list) --
The list of context keys that are referenced in the input policies.
Exceptions
Retrieves a credential report for the 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()
{
'Content': b'bytes',
'ReportFormat': 'text/csv',
'GeneratedTime': datetime(2015, 1, 1)
}
Response Structure
Contains the response to a successful GetCredentialReport request.
Contains the credential report. The report is Base64-encoded.
The format (MIME type) of the credential report.
The date and time when the credential report was created, in ISO 8601 date-time format .
Exceptions
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
)
[REQUIRED]
The name of the group.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetGroup request.
Group (dict) --
A structure that contains details about the group.
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
Users (list) --
A list of users in the group.
(dict) --
Contains information about an IAM user entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Retrieves the specified inline policy document that is embedded in the specified IAM group.
Note
Policies returned by this operation 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'
)
[REQUIRED]
The name of the group the policy is associated with.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the policy document to get.
This parameter allows (through 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: _+=,.@-
dict
Response Syntax
{
'GroupName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetGroupPolicy request.
GroupName (string) --
The group the policy is associated with.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
Exceptions
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'
)
[REQUIRED]
The name of the instance profile to get information about.
This parameter allows (through 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: _+=,.@-
{
'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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Contains the response to a successful GetInstanceProfile request.
A structure containing details about the instance profile.
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
The name identifying the instance profile.
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
The date when the instance profile was created.
The role associated with the instance profile.
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
The friendly name that identifies the role.
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
The date and time, in ISO 8601 date-time format , when the role was created.
The policy that grants an entity permission to assume the role.
A description of the role that you provide.
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
The ARN of the policy used to set the permissions boundary for the user or role.
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
The name of the Region in which the role was last used.
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Retrieves the user name for the specified IAM user. A login profile is created when you create a password for the user to access the Management Console. If the user does not exist or does not have a password, the operation returns a 404 (NoSuchEntity ) error.
If you create an IAM user with access to the console, the CreateDate reflects the date you created the initial password for the user.
If you create an IAM user with programmatic access, and then later add a password for the user to access the Management Console, the CreateDate reflects the initial password creation date. A user with programmatic access does not have a login profile unless you create a password for the user to access the Management Console.
See also: AWS API Documentation
Request Syntax
response = client.get_login_profile(
UserName='string'
)
[REQUIRED]
The name of the user whose login profile you want to retrieve.
This parameter allows (through 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: _+=,.@-
{
'LoginProfile': {
'UserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordResetRequired': True|False
}
}
Response Structure
Contains the response to a successful GetLoginProfile request.
A structure containing the user name and the profile creation date for the user.
The name of the user, which can be used for signing in to the Management Console.
The date when the password for the user was created.
Specifies whether the user is required to set a new password on next sign-in.
Exceptions
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': {
'...': '...',
},
}
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'
)
[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 operation.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
{
'Url': 'string',
'ClientIDList': [
'string',
],
'ThumbprintList': [
'string',
],
'CreateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
Contains the response to a successful GetOpenIDConnectProvider request.
The URL that the IAM OIDC provider resource object is associated with. For more information, see CreateOpenIDConnectProvider .
A list of client IDs (also known as audiences) that are associated with the specified IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider .
A list of certificate thumbprints that are associated with the specified IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider .
Contains a thumbprint for an identity provider's server certificate.
The identity provider's server certificate thumbprint is the hex-encoded SHA-1 hash value of the self-signed X.509 certificate. This thumbprint is used by the domain where the OpenID Connect provider makes its keys available. The thumbprint is always a 40-character string.
The date and time when the IAM OIDC provider resource object was created in the account.
A list of tags that are attached to the specified IAM OIDC provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
Retrieves the service last accessed data report for Organizations that was previously generated using the `` GenerateOrganizationsAccessReport `` operation. This operation retrieves the status of your report job and the report contents.
Depending on the parameters that you passed when you generated the report, the data returned could include different information. For details, see GenerateOrganizationsAccessReport .
To call this operation, you must be signed in to the management account in your organization. SCPs must be enabled for your organization root. You must have permissions to perform this operation. For more information, see Refining permissions using service last accessed data in the IAM User Guide .
For each service that principals in an account (root users, IAM users, or IAM roles) could access using SCPs, the operation returns details about the most recent access attempt. If there was no attempt, the service is listed without details about the most recent attempt to access the service. If the operation fails, it returns the reason that it failed.
By default, the list is sorted by service namespace.
See also: AWS API Documentation
Request Syntax
response = client.get_organizations_access_report(
JobId='string',
MaxItems=123,
Marker='string',
SortKey='SERVICE_NAMESPACE_ASCENDING'|'SERVICE_NAMESPACE_DESCENDING'|'LAST_AUTHENTICATED_TIME_ASCENDING'|'LAST_AUTHENTICATED_TIME_DESCENDING'
)
[REQUIRED]
The identifier of the request generated by the GenerateOrganizationsAccessReport operation.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'JobStatus': 'IN_PROGRESS'|'COMPLETED'|'FAILED',
'JobCreationDate': datetime(2015, 1, 1),
'JobCompletionDate': datetime(2015, 1, 1),
'NumberOfServicesAccessible': 123,
'NumberOfServicesNotAccessed': 123,
'AccessDetails': [
{
'ServiceName': 'string',
'ServiceNamespace': 'string',
'Region': 'string',
'EntityPath': 'string',
'LastAuthenticatedTime': datetime(2015, 1, 1),
'TotalAuthenticatedEntities': 123
},
],
'IsTruncated': True|False,
'Marker': 'string',
'ErrorDetails': {
'Message': 'string',
'Code': 'string'
}
}
Response Structure
(dict) --
JobStatus (string) --
The status of the job.
JobCreationDate (datetime) --
The date and time, in ISO 8601 date-time format , when the report job was created.
JobCompletionDate (datetime) --
The date and time, in ISO 8601 date-time format , when the generated report job was completed or failed.
This field is null if the job is still in progress, as indicated by a job status value of IN_PROGRESS .
NumberOfServicesAccessible (integer) --
The number of services that the applicable SCPs allow account principals to access.
NumberOfServicesNotAccessed (integer) --
The number of services that account principals are allowed but did not attempt to access.
AccessDetails (list) --
An object that contains details about the most recent attempt to access the service.
(dict) --
An object that contains details about when a principal in the reported Organizations entity last attempted to access an Amazon Web Services service. A principal can be an IAM user, an IAM role, or the Amazon Web Services account root user within the reported Organizations entity.
This data type is a response element in the GetOrganizationsAccessReport operation.
ServiceName (string) --
The name of the service in which access was attempted.
ServiceNamespace (string) --
The namespace of the service in which access was attempted.
To learn the service namespace of a service, see Actions, resources, and condition keys for Amazon Web Services services in the Service Authorization Reference . Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, (service prefix: a4b) . For more information about service namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference .
Region (string) --
The Region where the last service access attempt occurred.
This field is null if no principals in the reported Organizations entity attempted to access the service within the reporting period .
EntityPath (string) --
The path of the Organizations entity (root, organizational unit, or account) from which an authenticated principal last attempted to access the service. Amazon Web Services does not report unauthenticated requests.
This field is null if no principals (IAM users, IAM roles, or root users) in the reported Organizations entity attempted to access the service within the reporting period .
LastAuthenticatedTime (datetime) --
The date and time, in ISO 8601 date-time format , when an authenticated principal most recently attempted to access the service. Amazon Web Services does not report unauthenticated requests.
This field is null if no principals in the reported Organizations entity attempted to access the service within the reporting period .
TotalAuthenticatedEntities (integer) --
The number of accounts with authenticated principals (root users, IAM users, and IAM roles) that attempted to access the service in the reporting period.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
ErrorDetails (dict) --
Contains information about the reason that the operation failed.
This data type is used as a response element in the GetOrganizationsAccessReport , GetServiceLastAccessedDetails , and GetServiceLastAccessedDetailsWithEntities operations.
Message (string) --
Detailed information about the reason that the operation failed.
Code (string) --
The error code associated with the operation failure.
Exceptions
Create a paginator for an operation.
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 ListEntitiesForPolicy . This operation returns metadata about the policy. To retrieve the actual policy document for a specific version of the policy, use GetPolicyVersion .
This operation retrieves information about managed policies. To retrieve information about an inline policy that is embedded with an IAM user, group, or role, use GetUserPolicy , GetGroupPolicy , or GetRolePolicy .
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'
)
[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) in the Amazon Web Services General Reference .
{
'Policy': {
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Contains the response to a successful GetPolicy request.
A structure containing details about the policy.
The friendly name (not ARN) identifying the policy.
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
The identifier for the version of the policy that is set as the default version.
The number of entities (users, groups, and roles) that the policy is attached to.
The number of entities (users and roles) for which the policy is used to set the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
Specifies whether the policy can be attached to an IAM user, group, or role.
A friendly description of the policy.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
The date and time, in ISO 8601 date-time format , when the policy was created.
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
Retrieves information about the specified version of the specified managed policy, including the policy document.
Note
Policies returned by this operation 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 operation retrieves information about managed policies. To retrieve information about an inline policy that is embedded in a user, group, or role, use GetUserPolicy , GetGroupPolicy , or GetRolePolicy .
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'
)
[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) in the Amazon Web Services General Reference .
[REQUIRED]
Identifies the policy version to retrieve.
This parameter allows (through its regex pattern ) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.
dict
Response Syntax
{
'PolicyVersion': {
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful GetPolicyVersion request.
PolicyVersion (dict) --
A structure containing details about the policy version.
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
Exceptions
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 operation 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'
)
[REQUIRED]
The name of the IAM role to get information about.
This parameter allows (through 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: _+=,.@-
{
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
}
}
Response Structure
Contains the response to a successful GetRole request.
A structure containing details about the IAM role.
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
The friendly name that identifies the role.
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
The date and time, in ISO 8601 date-time format , when the role was created.
The policy that grants an entity permission to assume the role.
A description of the role that you provide.
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
The ARN of the policy used to set the permissions boundary for the user or role.
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
The name of the Region in which the role was last used.
Exceptions
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': {
'...': '...',
},
}
Retrieves the specified inline policy document that is embedded with the specified IAM role.
Note
Policies returned by this operation 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'
)
[REQUIRED]
The name of the role associated with the policy.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the policy document to get.
This parameter allows (through 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: _+=,.@-
dict
Response Syntax
{
'RoleName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetRolePolicy request.
RoleName (string) --
The role the policy is associated with.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
Exceptions
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'
)
[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) in the Amazon Web Services General Reference .
{
'SAMLMetadataDocument': 'string',
'CreateDate': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
Contains the response to a successful GetSAMLProvider request.
The XML metadata document that includes information about an identity provider.
The date and time when the SAML provider was created.
The expiration date and time for the SAML provider.
A list of tags that are attached to the specified IAM SAML provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
Retrieves information about the specified server certificate stored in IAM.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
See also: AWS API Documentation
Request Syntax
response = client.get_server_certificate(
ServerCertificateName='string'
)
[REQUIRED]
The name of the server certificate you want to retrieve information about.
This parameter allows (through 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: _+=,.@-
{
'ServerCertificate': {
'ServerCertificateMetadata': {
'Path': 'string',
'ServerCertificateName': 'string',
'ServerCertificateId': 'string',
'Arn': 'string',
'UploadDate': datetime(2015, 1, 1),
'Expiration': datetime(2015, 1, 1)
},
'CertificateBody': 'string',
'CertificateChain': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Contains the response to a successful GetServerCertificate request.
A structure containing details about the server certificate.
The meta information of the server certificate, such as its name, path, ID, and ARN.
The path to the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
The name that identifies the server certificate.
The stable and unique string identifying the server certificate. For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN) specifying the server certificate. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
The date when the server certificate was uploaded.
The date on which the certificate is set to expire.
The contents of the public key certificate.
The contents of the public key certificate chain.
A list of tags that are attached to the server certificate. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
Retrieves a service last accessed report that was created using the GenerateServiceLastAccessedDetails operation. You can use the JobId parameter in GetServiceLastAccessedDetails to retrieve the status of your report job. When the report is complete, you can retrieve the generated report. The report includes a list of Amazon Web Services services that the resource (user, group, role, or managed policy) can access.
Note
Service last accessed data does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, Organizations policies, IAM permissions boundaries, and STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating policies in the IAM User Guide .
For each service that the resource could access using permissions policies, the operation returns details about the most recent access attempt. If there was no attempt, the service is listed without details about the most recent attempt to access the service. If the operation fails, the GetServiceLastAccessedDetails operation returns the reason that it failed.
The GetServiceLastAccessedDetails operation returns a list of services. This list includes the number of entities that have attempted to access the service and the date and time of the last attempt. It also returns the ARN of the following entity, depending on the resource ARN that you used to generate the report:
By default, the list is sorted by service namespace.
If you specified ACTION_LEVEL granularity when you generated the report, this operation returns service and action last accessed data. This includes the most recent access attempt for each tracked action within a service. Otherwise, this operation returns only service data.
For more information about service and action last accessed data, see Reducing permissions using service last accessed data in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_service_last_accessed_details(
JobId='string',
MaxItems=123,
Marker='string'
)
[REQUIRED]
The ID of the request generated by the GenerateServiceLastAccessedDetails operation. The JobId returned by GenerateServiceLastAccessedDetail must be used by the same role within a session, or by the same user when used to call GetServiceLastAccessedDetail .
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'JobStatus': 'IN_PROGRESS'|'COMPLETED'|'FAILED',
'JobType': 'SERVICE_LEVEL'|'ACTION_LEVEL',
'JobCreationDate': datetime(2015, 1, 1),
'ServicesLastAccessed': [
{
'ServiceName': 'string',
'LastAuthenticated': datetime(2015, 1, 1),
'ServiceNamespace': 'string',
'LastAuthenticatedEntity': 'string',
'LastAuthenticatedRegion': 'string',
'TotalAuthenticatedEntities': 123,
'TrackedActionsLastAccessed': [
{
'ActionName': 'string',
'LastAccessedEntity': 'string',
'LastAccessedTime': datetime(2015, 1, 1),
'LastAccessedRegion': 'string'
},
]
},
],
'JobCompletionDate': datetime(2015, 1, 1),
'IsTruncated': True|False,
'Marker': 'string',
'Error': {
'Message': 'string',
'Code': 'string'
}
}
Response Structure
(dict) --
JobStatus (string) --
The status of the job.
JobType (string) --
The type of job. Service jobs return information about when each service was last accessed. Action jobs also include information about when tracked actions within the service were last accessed.
JobCreationDate (datetime) --
The date and time, in ISO 8601 date-time format , when the report job was created.
ServicesLastAccessed (list) --
A ServiceLastAccessed object that contains details about the most recent attempt to access the service.
(dict) --
Contains details about the most recent attempt to access the service.
This data type is used as a response element in the GetServiceLastAccessedDetails operation.
ServiceName (string) --
The name of the service in which access was attempted.
LastAuthenticated (datetime) --
The date and time, in ISO 8601 date-time format , when an authenticated entity most recently attempted to access the service. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
ServiceNamespace (string) --
The namespace of the service in which access was attempted.
To learn the service namespace of a service, see Actions, resources, and condition keys for Amazon Web Services services in the Service Authorization Reference . Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, (service prefix: a4b) . For more information about service namespaces, see Amazon Web Services Service Namespaces in the Amazon Web Services General Reference .
LastAuthenticatedEntity (string) --
The ARN of the authenticated entity (user or role) that last attempted to access the service. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
LastAuthenticatedRegion (string) --
The Region from which the authenticated entity (user or role) last attempted to access the service. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
TotalAuthenticatedEntities (integer) --
The total number of authenticated principals (root user, IAM users, or IAM roles) that have attempted to access the service.
This field is null if no principals attempted to access the service within the reporting period .
TrackedActionsLastAccessed (list) --
An object that contains details about the most recent attempt to access a tracked action within the service.
This field is null if there no tracked actions or if the principal did not use the tracked actions within the reporting period . This field is also null if the report was generated at the service level and not the action level. For more information, see the Granularity field in GenerateServiceLastAccessedDetails .
(dict) --
Contains details about the most recent attempt to access an action within the service.
This data type is used as a response element in the GetServiceLastAccessedDetails operation.
ActionName (string) --
The name of the tracked action to which access was attempted. Tracked actions are actions that report activity to IAM.
LastAccessedEntity (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
LastAccessedTime (datetime) --
The date and time, in ISO 8601 date-time format , when an authenticated entity most recently attempted to access the tracked service. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
LastAccessedRegion (string) --
The Region from which the authenticated entity (user or role) last attempted to access the tracked action. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
JobCompletionDate (datetime) --
The date and time, in ISO 8601 date-time format , when the generated report job was completed or failed.
This field is null if the job is still in progress, as indicated by a job status value of IN_PROGRESS .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Error (dict) --
An object that contains details about the reason the operation failed.
Message (string) --
Detailed information about the reason that the operation failed.
Code (string) --
The error code associated with the operation failure.
Exceptions
After you generate a group or policy report using the GenerateServiceLastAccessedDetails operation, you can use the JobId parameter in GetServiceLastAccessedDetailsWithEntities . This operation retrieves the status of your report job and a list of entities that could have used group or policy permissions to access the specified service.
You can also use this operation for user or role reports to retrieve details about those entities.
If the operation fails, the GetServiceLastAccessedDetailsWithEntities operation returns the reason that it failed.
By default, the list of associated entities is sorted by date, with the most recent access listed first.
See also: AWS API Documentation
Request Syntax
response = client.get_service_last_accessed_details_with_entities(
JobId='string',
ServiceNamespace='string',
MaxItems=123,
Marker='string'
)
[REQUIRED]
The ID of the request generated by the GenerateServiceLastAccessedDetails operation.
[REQUIRED]
The service namespace for an Amazon Web Services service. Provide the service namespace to learn when the IAM entity last attempted to access the specified service.
To learn the service namespace for a service, see Actions, resources, and condition keys for Amazon Web Services services in the IAM User Guide . Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, (service prefix: a4b) . For more information about service namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference .
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'JobStatus': 'IN_PROGRESS'|'COMPLETED'|'FAILED',
'JobCreationDate': datetime(2015, 1, 1),
'JobCompletionDate': datetime(2015, 1, 1),
'EntityDetailsList': [
{
'EntityInfo': {
'Arn': 'string',
'Name': 'string',
'Type': 'USER'|'ROLE'|'GROUP',
'Id': 'string',
'Path': 'string'
},
'LastAuthenticated': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string',
'Error': {
'Message': 'string',
'Code': 'string'
}
}
Response Structure
(dict) --
JobStatus (string) --
The status of the job.
JobCreationDate (datetime) --
The date and time, in ISO 8601 date-time format , when the report job was created.
JobCompletionDate (datetime) --
The date and time, in ISO 8601 date-time format , when the generated report job was completed or failed.
This field is null if the job is still in progress, as indicated by a job status value of IN_PROGRESS .
EntityDetailsList (list) --
An EntityDetailsList object that contains details about when an IAM entity (user or role) used group or policy permissions in an attempt to access the specified Amazon Web Services service.
(dict) --
An object that contains details about when the IAM entities (users or roles) were last used in an attempt to access the specified Amazon Web Services service.
This data type is a response element in the GetServiceLastAccessedDetailsWithEntities operation.
EntityInfo (dict) --
The EntityInfo object that contains details about the entity (user or role).
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Name (string) --
The name of the entity (user or role).
Type (string) --
The type of entity (user or role).
Id (string) --
The identifier of the entity (user or role).
Path (string) --
The path to the entity (user or role). For more information about paths, see IAM identifiers in the IAM User Guide .
LastAuthenticated (datetime) --
The date and time, in ISO 8601 date-time format , when the authenticated entity last attempted to access Amazon Web Services. Amazon Web Services does not report unauthenticated requests.
This field is null if no IAM entities attempted to access the service within the reporting period .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Error (dict) --
An object that contains details about the reason the operation failed.
Message (string) --
Detailed information about the reason that the operation failed.
Code (string) --
The error code associated with the operation failure.
Exceptions
Retrieves the status of your service-linked role deletion. After you use DeleteServiceLinkedRole to submit a service-linked role for deletion, you can use the DeletionTaskId parameter in GetServiceLinkedRoleDeletionStatus to check the status of the deletion. If the deletion fails, this operation returns the reason that it failed, if that information is returned by the service.
See also: AWS API Documentation
Request Syntax
response = client.get_service_linked_role_deletion_status(
DeletionTaskId='string'
)
[REQUIRED]
The deletion task identifier. This identifier is returned by the DeleteServiceLinkedRole operation in the format task/aws-service-role/<service-principal-name>/<role-name>/<task-uuid> .
{
'Status': 'SUCCEEDED'|'IN_PROGRESS'|'FAILED'|'NOT_STARTED',
'Reason': {
'Reason': 'string',
'RoleUsageList': [
{
'Region': 'string',
'Resources': [
'string',
]
},
]
}
}
Response Structure
The status of the deletion.
An object that contains details about the reason the deletion failed.
A short description of the reason that the service-linked role deletion failed.
A list of objects that contains details about the service-linked role deletion failure, if that information is returned by the service. If the service-linked role has active sessions or if any resources that were used by the role have not been deleted from the linked service, the role can't be deleted. This parameter includes a list of the resources that are associated with the role and the Region in which the resources are being used.
An object that contains details about how a service-linked role is used, if that information is returned by the service.
This data type is used as a response element in the GetServiceLinkedRoleDeletionStatus operation.
The name of the Region where the service-linked role is being used.
The name of the resource that is using the service-linked role.
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Exceptions
Retrieves the specified SSH public key, including metadata about the key.
The SSH public key retrieved by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_ssh_public_key(
UserName='string',
SSHPublicKeyId='string',
Encoding='SSH'|'PEM'
)
[REQUIRED]
The name of the IAM user associated with the SSH public key.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier for the SSH public key.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
[REQUIRED]
Specifies the public key encoding format to use in the response. To retrieve the public key in ssh-rsa format, use SSH . To retrieve the public key in PEM format, use PEM .
dict
Response Syntax
{
'SSHPublicKey': {
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Fingerprint': 'string',
'SSHPublicKeyBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful GetSSHPublicKey request.
SSHPublicKey (dict) --
A structure containing details about the SSH public key.
UserName (string) --
The name of the IAM user associated with the SSH public key.
SSHPublicKeyId (string) --
The unique identifier for the SSH public key.
Fingerprint (string) --
The MD5 message digest of the SSH public key.
SSHPublicKeyBody (string) --
The SSH public key.
Status (string) --
The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used.
UploadDate (datetime) --
The date and time, in ISO 8601 date-time format , when the SSH public key was uploaded.
Exceptions
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 Amazon Web Services access key ID used to sign the request to this operation.
See also: AWS API Documentation
Request Syntax
response = client.get_user(
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 (through 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: _+=,.@-
{
'User': {
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Contains the response to a successful GetUser request.
A structure containing details about the IAM user.
Warning
Due to a service issue, password last used data does not include password use from May 3, 2018 22:50 PDT to May 23, 2018 14:08 PDT. This affects last sign-in dates shown in the IAM console and password last used dates in the IAM credential report , and returned by this operation. If users signed in during the affected time, the password last used date that is returned is the date the user last signed in before May 3, 2018. For users that signed in after May 23, 2018 14:08 PDT, the returned password last used date is accurate.
You can use password last used information to identify unused credentials for deletion. For example, you might delete users who did not sign in to Amazon Web Services in the last 90 days. In cases like this, we recommend that you adjust your evaluation window to include dates after May 23, 2018. Alternatively, if your users use access keys to access Amazon Web Services programmatically you can refer to access key last used information because it is accurate for all dates.
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
The friendly name identifying the user.
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
The date and time, in ISO 8601 date-time format , when the user was created.
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
The ARN of the policy used to set the permissions boundary for the user or role.
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Retrieves the specified inline policy document that is embedded in the specified IAM user.
Note
Policies returned by this operation 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'
)
[REQUIRED]
The name of the user who the policy is associated with.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the policy document to get.
This parameter allows (through 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: _+=,.@-
dict
Response Syntax
{
'UserName': 'string',
'PolicyName': 'string',
'PolicyDocument': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetUserPolicy request.
UserName (string) --
The user the policy is associated with.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
Exceptions
Returns an object that can wait for some condition.
Returns information about the access key IDs associated with the specified IAM user. If there is none, the operation 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 user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
Note
To ensure the security of your 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
)
The name of the user.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'AccessKeyMetadata': [
{
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAccessKeys request.
AccessKeyMetadata (list) --
A list of objects containing metadata about the access keys.
(dict) --
Contains information about an Amazon Web Services access key, without its secret key.
This data type is used as a response element in the ListAccessKeys operation.
UserName (string) --
The name of the IAM user that the key is associated with.
AccessKeyId (string) --
The ID for this access key.
Status (string) --
The status of the access key. Active means that the key is valid for API calls; Inactive means it is not.
CreateDate (datetime) --
The date when the access key was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
Lists the account alias associated with the account (Note: you can have only one). For information about using an account alias, see Using an alias for your account ID in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_account_aliases(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'AccountAliases': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAccountAliases request.
AccountAliases (list) --
A list of aliases associated with the account. Amazon Web Services supports only one alias per account.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Examples
The following command lists the aliases for the current account.
response = client.list_account_aliases(
)
print(response)
Expected Output:
{
'AccountAliases': [
'exmaple-corporation',
],
'ResponseMetadata': {
'...': '...',
},
}
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 ListGroupPolicies . 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 operation 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
)
[REQUIRED]
The name (friendly name, not ARN) of the group to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedGroupPolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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 ListRolePolicies . 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 operation 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
)
[REQUIRED]
The name (friendly name, not ARN) of the role to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedRolePolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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 ListUserPolicies . 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 operation 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
)
[REQUIRED]
The name (friendly name, not ARN) of the user to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedUserPolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
The entity type to use for filtering the results.
For example, when EntityFilter is Role , only the roles that are attached to the specified policy are returned. This parameter is optional. If it is not included, all attached entities (users, groups, and roles) are returned. The argument for this parameter must be one of the valid values listed below.
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'PolicyGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'PolicyUsers': [
{
'UserName': 'string',
'UserId': 'string'
},
],
'PolicyRoles': [
{
'RoleName': 'string',
'RoleId': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListEntitiesForPolicy request.
PolicyGroups (list) --
A list of IAM groups that the policy is attached to.
(dict) --
Contains information about a group that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
GroupName (string) --
The name (friendly name, not ARN) identifying the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
PolicyUsers (list) --
A list of IAM users that the policy is attached to.
(dict) --
Contains information about a user that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
UserName (string) --
The name (friendly name, not ARN) identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
PolicyRoles (list) --
A list of IAM roles that the policy is attached to.
(dict) --
Contains information about a role that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
RoleName (string) --
The name (friendly name, not ARN) identifying the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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 operation returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_group_policies(
GroupName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the group to list policies for.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroupPolicies request.
PolicyNames (list) --
A list of policy names.
This parameter allows (through 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: _+=,.@-
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
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
)
The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ gets all groups whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all groups. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroups request.
Groups (list) --
A list of groups.
(dict) --
Contains information about an IAM group entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
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
)
[REQUIRED]
The name of the user to list groups for.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroupsForUser request.
Groups (list) --
A list of groups.
(dict) --
Contains information about an IAM group entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
Lists the tags that are attached to the specified IAM instance profile. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_instance_profile_tags(
InstanceProfileName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the IAM instance profile whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the IAM instance profile. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the instance profiles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about instance profiles, see About instance profiles .
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for an instance profile, see GetInstanceProfile .
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
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all instance profiles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all instance profiles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListInstanceProfiles request.
InstanceProfiles (list) --
A list of instance profiles.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the instance profiles that have the specified associated IAM role. If there are none, the operation 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
)
[REQUIRED]
The name of the role to list instance profiles for.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListInstanceProfilesForRole request.
InstanceProfiles (list) --
A list of instance profiles.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified IAM virtual multi-factor authentication (MFA) device. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_mfa_device_tags(
SerialNumber='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The unique identifier for the IAM virtual MFA device whose tags you want to see. For virtual MFA devices, the serial number is the same as the ARN.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the virtual MFA device. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the MFA devices for an IAM user. If the request includes a IAM user name, then this operation 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 Amazon Web Services access key ID signing the request for this operation.
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
)
The name of the user whose MFA devices you want to list.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'MFADevices': [
{
'UserName': 'string',
'SerialNumber': 'string',
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListMFADevices request.
MFADevices (list) --
A list of MFA devices.
(dict) --
Contains information about an MFA device.
This data type is used as a response element in the ListMFADevices operation.
UserName (string) --
The user with whom the MFA device is associated.
SerialNumber (string) --
The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.
EnableDate (datetime) --
The date when the MFA device was enabled for the user.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified OpenID Connect (OIDC)-compatible identity provider. The returned list of tags is sorted by tag key. For more information, see About web identity federation .
For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_open_id_connect_provider_tags(
OpenIDConnectProviderArn='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The ARN of the OpenID Connect (OIDC) identity provider whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the OpenID Connect (OIDC) identity provider. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists information about the IAM OpenID Connect (OIDC) provider resource objects defined in the account.
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for an OIDC provider, see GetOpenIDConnectProvider .
See also: AWS API Documentation
Request Syntax
response = client.list_open_id_connect_providers()
{
'OpenIDConnectProviderList': [
{
'Arn': 'string'
},
]
}
Response Structure
Contains the response to a successful ListOpenIDConnectProviders request.
The list of IAM OIDC provider resource objects defined in the account.
Contains the Amazon Resource Name (ARN) for an IAM OpenID Connect provider.
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Exceptions
Lists all the managed policies that are available in your account, including your own customer-defined managed policies and all Amazon Web Services 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 Amazon Web Services account, set Scope to Local . To list only Amazon Web Services 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 .
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a customer manged policy, see GetPolicy .
See also: AWS API Documentation
Request Syntax
response = client.list_policies(
Scope='All'|'AWS'|'Local',
OnlyAttached=True|False,
PathPrefix='string',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
The scope to use for filtering the results.
To list only Amazon Web Services managed policies, set Scope to AWS . To list only the customer managed policies in your account, set Scope to Local .
This parameter is optional. If it is not included, or if it is set to All , all policies are returned.
A flag to filter the results to only the attached policies.
When OnlyAttached is true , the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached is false , or when the parameter is not included, all policies are returned.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListPolicies request.
Policies (list) --
A list of policies.
(dict) --
Contains information about a managed policy.
This data type is used as a response element in the CreatePolicy , GetPolicy , and ListPolicies operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name (not ARN) identifying the policy.
PolicyId (string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Path (string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
DefaultVersionId (string) --
The identifier for the version of the policy that is set as the default version.
AttachmentCount (integer) --
The number of entities (users, groups, and roles) that the policy is attached to.
PermissionsBoundaryUsageCount (integer) --
The number of entities (users and roles) for which the policy is used to set the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
IsAttachable (boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
Description (string) --
A friendly description of the policy.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
UpdateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Retrieves a list of policies that the IAM identity (user, group, or role) can use to access each specified service.
Note
This operation does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, Organizations policies, IAM permissions boundaries, and STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating policies in the IAM User Guide .
The list of policies returned by the operation depends on the ARN of the identity that you provide.
For each managed policy, this operation returns the ARN and policy name. For each inline policy, it returns the policy name and the entity to which it is attached. Inline policies do not have an ARN. For more information about these policy types, see Managed policies and inline policies in the IAM User Guide .
Policies that are attached to users and roles as permissions boundaries are not returned. To view which managed policy is currently used to set the permissions boundary for a user or role, use the GetUser or GetRole operations.
See also: AWS API Documentation
Request Syntax
response = client.list_policies_granting_service_access(
Marker='string',
Arn='string',
ServiceNamespaces=[
'string',
]
)
[REQUIRED]
The ARN of the IAM identity (user, group, or role) whose policies you want to list.
[REQUIRED]
The service namespace for the Amazon Web Services services whose policies you want to list.
To learn the service namespace for a service, see Actions, resources, and condition keys for Amazon Web Services services in the IAM User Guide . Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, (service prefix: a4b) . For more information about service namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference .
dict
Response Syntax
{
'PoliciesGrantingServiceAccess': [
{
'ServiceNamespace': 'string',
'Policies': [
{
'PolicyName': 'string',
'PolicyType': 'INLINE'|'MANAGED',
'PolicyArn': 'string',
'EntityType': 'USER'|'ROLE'|'GROUP',
'EntityName': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
PoliciesGrantingServiceAccess (list) --
A ListPoliciesGrantingServiceAccess object that contains details about the permissions policies attached to the specified identity (user, group, or role).
(dict) --
Contains details about the permissions policies that are attached to the specified identity (user, group, or role).
This data type is used as a response element in the ListPoliciesGrantingServiceAccess operation.
ServiceNamespace (string) --
The namespace of the service that was accessed.
To learn the service namespace of a service, see Actions, resources, and condition keys for Amazon Web Services services in the Service Authorization Reference . Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, (service prefix: a4b) . For more information about service namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference .
Policies (list) --
The PoliciesGrantingServiceAccess object that contains details about the policy.
(dict) --
Contains details about the permissions policies that are attached to the specified identity (user, group, or role).
This data type is an element of the ListPoliciesGrantingServiceAccessEntry object.
PolicyName (string) --
The policy name.
PolicyType (string) --
The policy type. For more information about these policy types, see Managed policies and inline policies in the IAM User Guide .
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
EntityType (string) --
The type of entity (user or role) that used the policy to access the service to which the inline policy is attached.
This field is null for managed policies. For more information about these policy types, see Managed policies and inline policies in the IAM User Guide .
EntityName (string) --
The name of the entity (user or role) to which the inline policy is attached.
This field is null for managed policies. For more information about these policy types, see Managed policies and inline policies in the IAM User Guide .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified IAM customer managed policy. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_policy_tags(
PolicyArn='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The ARN of the IAM customer managed policy whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the IAM customer managed policy. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Versions': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListPolicyVersions request.
Versions (list) --
A list of policy versions.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
(dict) --
Contains information about a version of a managed policy.
This data type is used as a response element in the CreatePolicyVersion , GetPolicyVersion , ListPolicyVersions , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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 operation returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_role_policies(
RoleName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the role to list policies for.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListRolePolicies request.
PolicyNames (list) --
A list of policy names.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified role. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_role_tags(
RoleName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the IAM role for which you want to see the list of tags.
This parameter accepts (through its regex pattern ) a string of characters that consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the role. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about roles, see Working with roles .
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a role, see GetRole .
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
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all roles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all roles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListRoles request.
Roles (list) --
A list of roles.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified Security Assertion Markup Language (SAML) identity provider. The returned list of tags is sorted by tag key. For more information, see About SAML 2.0-based federation .
For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_saml_provider_tags(
SAMLProviderArn='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The ARN of the Security Assertion Markup Language (SAML) identity provider whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the Security Assertion Markup Language (SAML) identity provider. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the SAML provider resource objects defined in IAM in the account. IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a SAML provider, see GetSAMLProvider .
Warning
This operation requires Signature Version 4 .
See also: AWS API Documentation
Request Syntax
response = client.list_saml_providers()
{
'SAMLProviderList': [
{
'Arn': 'string',
'ValidUntil': datetime(2015, 1, 1),
'CreateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
Contains the response to a successful ListSAMLProviders request.
The list of SAML provider resource objects defined in IAM for this Amazon Web Services account.
Contains the list of SAML providers for this account.
The Amazon Resource Name (ARN) of the SAML provider.
The expiration date and time for the SAML provider.
The date and time when the SAML provider was created.
Exceptions
Lists the tags that are attached to the specified IAM server certificate. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
For certificates in a Region supported by Certificate Manager (ACM), we recommend that you don't use IAM server certificates. Instead, use ACM to provision, manage, and deploy your server certificates. For more information about IAM server certificates, Working with server certificates in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_server_certificate_tags(
ServerCertificateName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the IAM server certificate whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the IAM server certificate. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the server certificates stored in IAM that have the specified path prefix. If none exist, the operation returns an empty list.
You can paginate the results using the MaxItems and Marker parameters.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic also includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a servercertificate, see GetServerCertificate .
See also: AWS API Documentation
Request Syntax
response = client.list_server_certificates(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example: /company/servercerts would get all server certificates for which the path starts with /company/servercerts .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all server certificates. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'ServerCertificateMetadataList': [
{
'Path': 'string',
'ServerCertificateName': 'string',
'ServerCertificateId': 'string',
'Arn': 'string',
'UploadDate': datetime(2015, 1, 1),
'Expiration': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListServerCertificates request.
ServerCertificateMetadataList (list) --
A list of server certificates.
(dict) --
Contains information about a server certificate without its certificate body, certificate chain, and private key.
This data type is used as a response element in the UploadServerCertificate and ListServerCertificates operations.
Path (string) --
The path to the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
ServerCertificateName (string) --
The name that identifies the server certificate.
ServerCertificateId (string) --
The stable and unique string identifying the server certificate. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the server certificate. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
UploadDate (datetime) --
The date when the server certificate was uploaded.
Expiration (datetime) --
The date on which the certificate is set to expire.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an Amazon Web Services service, see Set up service-specific credentials in the CodeCommit User Guide.
See also: AWS API Documentation
Request Syntax
response = client.list_service_specific_credentials(
UserName='string',
ServiceName='string'
)
The name of the user whose service-specific credentials you want information about. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.
This parameter allows (through 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: _+=,.@-
dict
Response Syntax
{
'ServiceSpecificCredentials': [
{
'UserName': 'string',
'Status': 'Active'|'Inactive',
'ServiceUserName': 'string',
'CreateDate': datetime(2015, 1, 1),
'ServiceSpecificCredentialId': 'string',
'ServiceName': 'string'
},
]
}
Response Structure
(dict) --
ServiceSpecificCredentials (list) --
A list of structures that each contain details about a service-specific credential.
(dict) --
Contains additional details about a service-specific credential.
UserName (string) --
The name of the IAM user associated with the service-specific credential.
Status (string) --
The status of the service-specific credential. Active means that the key is valid for API calls, while Inactive means it is not.
ServiceUserName (string) --
The generated user name for the service-specific credential.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the service-specific credential were created.
ServiceSpecificCredentialId (string) --
The unique identifier for the service-specific credential.
ServiceName (string) --
The name of the service associated with the service-specific credential.
Exceptions
Returns information about the signing certificates associated with the specified IAM user. If none exists, the operation 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 Amazon Web Services access key ID used to sign the request for this operation. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.list_signing_certificates(
UserName='string',
Marker='string',
MaxItems=123
)
The name of the IAM user whose signing certificates you want to examine.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Certificates': [
{
'UserName': 'string',
'CertificateId': 'string',
'CertificateBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListSigningCertificates request.
Certificates (list) --
A list of the user's signing certificate information.
(dict) --
Contains information about an X.509 signing certificate.
This data type is used as a response element in the UploadSigningCertificate and ListSigningCertificates operations.
UserName (string) --
The name of the user the signing certificate is associated with.
CertificateId (string) --
The ID for the signing certificate.
CertificateBody (string) --
The contents of the signing certificate.
Status (string) --
The status of the signing certificate. Active means that the key is valid for API calls, while Inactive means it is not.
UploadDate (datetime) --
The date when the signing certificate was uploaded.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
Returns information about the SSH public keys associated with the specified IAM user. If none exists, the operation returns an empty list.
The SSH public keys returned by this operation are used only for authenticating the IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the 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
)
The name of the IAM user to list SSH public keys for. If none is specified, the UserName field is determined implicitly based on the Amazon Web Services access key used to sign the request.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'SSHPublicKeys': [
{
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListSSHPublicKeys request.
SSHPublicKeys (list) --
A list of the SSH public keys assigned to IAM user.
(dict) --
Contains information about an SSH public key, without the key's body or fingerprint.
This data type is used as a response element in the ListSSHPublicKeys operation.
UserName (string) --
The name of the IAM user associated with the SSH public key.
SSHPublicKeyId (string) --
The unique identifier for the SSH public key.
Status (string) --
The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used.
UploadDate (datetime) --
The date and time, in ISO 8601 date-time format , when the SSH public key was uploaded.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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 operation returns an empty list.
See also: AWS API Documentation
Request Syntax
response = client.list_user_policies(
UserName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the user to list policies for.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListUserPolicies request.
PolicyNames (list) --
A list of policy names.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the tags that are attached to the specified IAM user. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_user_tags(
UserName='string',
Marker='string',
MaxItems=123
)
[REQUIRED]
The name of the IAM user whose tags you want to see.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Lists the IAM users that have the specified path prefix. If no path prefix is specified, the operation returns all users in the account. If there are none, the operation returns an empty list.
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a user, see GetUser .
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
)
The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/ , which would get all user names whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all user names. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
Response Syntax
{
'Users': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListUsers request.
Users (list) --
A list of users.
(dict) --
Contains information about an IAM user entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
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': {
'...': '...',
},
}
Lists the virtual MFA devices defined in the account by assignment status. If you do not specify an assignment status, the operation returns a list of all virtual MFA devices. Assignment status can be Assigned , Unassigned , or Any .
Note
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a virtual MFA device, see ListVirtualMFADevices .
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
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'EnableDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListVirtualMFADevices request.
VirtualMFADevices (list) --
The list of virtual MFA devices in the current account that match the AssignmentStatus value that was passed in the request.
(dict) --
Contains information about a virtual MFA device.
SerialNumber (string) --
The serial number associated with VirtualMFADevice .
Base32StringSeed (bytes) --
The base32 seed defined as specified in RFC3548 . The Base32StringSeed is base64-encoded.
QRCodePNG (bytes) --
A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String where $virtualMFADeviceName is one of the create call arguments. AccountName is the user name if set (otherwise, the account ID otherwise), and Base32String is the seed in base32 format. The Base32String value is base64-encoded.
User (dict) --
The IAM user associated with this virtual MFA device.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
EnableDate (datetime) --
The date and time on which the virtual MFA device was enabled.
Tags (list) --
A list of tags that are attached to the virtual MFA device. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
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': {
'...': '...',
},
}
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 the maximum number of inline policies that you can embed in a group, see IAM and STS quotas 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, see 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'
)
[REQUIRED]
The name of the group to associate the policy with.
This parameter allows (through 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: _+=,.@-.
[REQUIRED]
The name of the policy document.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to = IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
None
Exceptions
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': {
'...': '...',
},
}
Adds or updates the policy that is specified as the IAM role's permissions boundary. You can use an Amazon Web Services managed policy or a customer managed policy to set the boundary for a role. Use the boundary to control the maximum permissions that the role can have. Setting a permissions boundary is an advanced feature that can affect the permissions for the role.
You cannot set the boundary for a service-linked role.
Warning
Policies used as permissions boundaries do not provide permissions. You must also attach a permissions policy to the role. To learn how the effective permissions for a role are evaluated, see IAM JSON policy evaluation logic in the IAM User Guide.
See also: AWS API Documentation
Request Syntax
response = client.put_role_permissions_boundary(
RoleName='string',
PermissionsBoundary='string'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM role for which you want to set the permissions boundary.
[REQUIRED]
The ARN of the policy that is used to set the permissions boundary for the role.
None
Exceptions
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, see 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 the maximum number of inline policies that you can embed with a role, see IAM and STS quotas 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, see 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'
)
[REQUIRED]
The name of the role to associate the policy with.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the policy document.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
None
Exceptions
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': {
'...': '...',
},
}
Adds or updates the policy that is specified as the IAM user's permissions boundary. You can use an Amazon Web Services managed policy or a customer managed policy to set the boundary for a user. Use the boundary to control the maximum permissions that the user can have. Setting a permissions boundary is an advanced feature that can affect the permissions for the user.
Warning
Policies that are used as permissions boundaries do not provide permissions. You must also attach a permissions policy to the user. To learn how the effective permissions for a user are evaluated, see IAM JSON policy evaluation logic in the IAM User Guide.
See also: AWS API Documentation
Request Syntax
response = client.put_user_permissions_boundary(
UserName='string',
PermissionsBoundary='string'
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user for which you want to set the permissions boundary.
[REQUIRED]
The ARN of the policy that is used to set the permissions boundary for the user.
None
Exceptions
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 the maximum number of inline policies that you can embed in a user, see IAM and STS quotas 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, see 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'
)
[REQUIRED]
The name of the user to associate the policy with.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the policy document.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
None
Exceptions
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': {
'...': '...',
},
}
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 operation 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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM OIDC provider resource to remove the client ID from. You can get a list of OIDC provider ARNs by using the ListOpenIDConnectProviders operation.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
[REQUIRED]
The client ID (also known as audience) to remove from the IAM OIDC provider resource. For more information about client IDs, see CreateOpenIDConnectProvider .
None
Exceptions
Removes the specified IAM role from the specified EC2 instance profile.
Warning
Make sure that 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, see Working with roles . For more information about instance profiles, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = client.remove_role_from_instance_profile(
InstanceProfileName='string',
RoleName='string'
)
[REQUIRED]
The name of the instance profile to update.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the role to remove.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
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'
)
[REQUIRED]
The name of the group to update.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The name of the user to remove.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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': {
'...': '...',
},
}
Resets the password for a service-specific credential. The new password is Amazon Web Services 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'
)
The name of the IAM user associated with the service-specific credential. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier of the service-specific credential.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
dict
Response Syntax
{
'ServiceSpecificCredential': {
'CreateDate': datetime(2015, 1, 1),
'ServiceName': 'string',
'ServiceUserName': 'string',
'ServicePassword': 'string',
'ServiceSpecificCredentialId': 'string',
'UserName': 'string',
'Status': 'Active'|'Inactive'
}
}
Response Structure
(dict) --
ServiceSpecificCredential (dict) --
A structure with details about the updated service-specific credential, including the new password.
Warning
This is the only time that you can access the password. You cannot recover the password later, but you can reset it again.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the service-specific credential were created.
ServiceName (string) --
The name of the service associated with the service-specific credential.
ServiceUserName (string) --
The generated user name for the service-specific credential. This value is generated by combining the IAM user's name combined with the ID number of the Amazon Web Services account, as in jane-at-123456789012 , for example. This value cannot be configured by the user.
ServicePassword (string) --
The generated password for the service-specific credential.
ServiceSpecificCredentialId (string) --
The unique identifier for the service-specific credential.
UserName (string) --
The name of the IAM user associated with the service-specific credential.
Status (string) --
The status of the service-specific credential. Active means that the key is valid for API calls, while Inactive means it is not.
Exceptions
Synchronizes the specified MFA device with its IAM resource object on the Amazon Web Services servers.
For more information about creating and working with virtual MFA devices, see 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'
)
[REQUIRED]
The name of the user whose MFA device you want to resynchronize.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
Serial number that uniquely identifies the MFA device.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
An authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
[REQUIRED]
A subsequent authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
None
Exceptions
Sets the specified version of the specified policy as the policy's default (operative) version.
This operation 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 ListEntitiesForPolicy .
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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy whose default version you want to set.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
[REQUIRED]
The version of the policy to set as the default (operative) version.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
None
Exceptions
Sets the specified version of the global endpoint token as the token version used for the account.
By default, Security Token Service (STS) is available as a global service, and all STS requests go to a single endpoint at https://sts.amazonaws.com . Amazon Web Services recommends using Regional STS endpoints to reduce latency, build in redundancy, and increase session token availability. For information about Regional endpoints for STS, see Security Token Service endpoints and quotas in the Amazon Web Services General Reference .
If you make an STS call to the global endpoint, the resulting session tokens might be valid in some Regions but not others. It depends on the version that is set in this operation. Version 1 tokens are valid only in Regions that are available by default. These tokens do not work in manually enabled Regions, such as Asia Pacific (Hong Kong). Version 2 tokens are valid in all Regions. However, version 2 tokens are longer and might affect systems where you temporarily store tokens. For information, see Activating and deactivating STS in an Region in the IAM User Guide .
To view the current session token version, see the GlobalEndpointTokenVersion entry in the response of the GetAccountSummary operation.
See also: AWS API Documentation
Request Syntax
response = client.set_security_token_service_preferences(
GlobalEndpointTokenVersion='v1Token'|'v2Token'
)
[REQUIRED]
The version of the global endpoint token. Version 1 tokens are valid only in Regions that are available by default. These tokens do not work in manually enabled Regions, such as Asia Pacific (Hong Kong). Version 2 tokens are valid in all Regions. However, version 2 tokens are longer and might affect systems where you temporarily store tokens.
For information, see Activating and deactivating STS in an Region in the IAM User Guide .
Exceptions
Simulate how a set of IAM policies and optionally a resource-based policy works with a list of API operations and Amazon Web Services resources to determine the policies' effective permissions. The policies are provided as strings.
The simulation does not perform the API operations; it only checks the authorization to determine if the simulated policies allow or deny the operations. You can simulate resources that don't exist in your account.
If you want to simulate existing policies that are attached to an IAM user, group, or role, use SimulatePrincipalPolicy instead.
Context keys are variables that are maintained by Amazon Web Services and its services and which 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.
For more information about using the policy simulator, see Testing IAM policies with the IAM policy simulator in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.simulate_custom_policy(
PolicyInputList=[
'string',
],
PermissionsBoundaryPolicyInputList=[
'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'
)
[REQUIRED]
A list of policy documents to include in the simulation. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. Do not include any resource-based policies in this parameter. Any resource-based policy must be submitted with the ResourcePolicy parameter. The policies cannot be "scope-down" policies, such as you could include in a call to GetFederationToken or one of the AssumeRole API operations. In other words, do not use policies designed to restrict what a user can do while using the temporary credentials.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that an IAM entity can have. You can input only one permissions boundary when you pass a policy to this operation. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide . The policy input is specified as a string that contains the complete, valid JSON text of a permissions boundary policy.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
A list of names of API operations to evaluate in the simulation. Each operation is evaluated against each resource. Each operation must include the service identifier, such as iam:CreateUser . This operation does not support using wildcards (*) in an action name.
A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to * (all resources). Each API in the ActionNames parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.
The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the ResourcePolicy parameter.
If you include a ResourcePolicy , then it must be applicable to all of the resources included in the simulation or you receive an invalid input error.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
An ARN representing the account ID that specifies the owner of any simulated resource that does not identify its owner in the resource ARN. Examples of resource ARNs include an S3 bucket or object. If ResourceOwner is specified, it is also used as the account owner of any ResourcePolicy included in the simulation. If the ResourceOwner parameter is not specified, then the owner of the resources and the resource policy defaults to the account of the identity provided in CallerArn . This parameter is required only if you specify a resource-based policy and account that owns the resource is different from the account that owns the simulated calling user CallerArn .
The ARN for an account uses the following syntax: arn:aws:iam::*AWS-account-ID* :root . For example, to represent the account with the 112233445566 ID, use the following ARN: arn:aws:iam::112233445566-ID:root .
The ARN of the IAM user that you want to use as the simulated caller of the API operations. CallerArn is required if you include a ResourcePolicy so that the policy's Principal element has a value to use in evaluating the policy.
You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.
A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.
Contains information about a condition context key. It includes the name of the key and specifies the value (or values, if the context key supports multiple values) to use in the simulation. This information is used when evaluating the Condition elements of the input policies.
This data type is used as an input parameter to SimulateCustomPolicy and SimulatePrincipalPolicy .
The full name of a condition context key, including the service prefix. For example, aws:SourceIp or s3:VersionId .
The value (or values, if the condition context key supports multiple values) to provide to the simulation when the key is referenced by a Condition element in an input policy.
The data type of the value (or values) specified in the ContextKeyValues parameter.
Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.
Each of the EC2 scenarios requires that you specify instance, image, and security-group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the EC2 scenario includes VPC, then you must supply the network-interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the EC2 scenario options, see Supported platforms in the Amazon EC2 User Guide .
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': 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'
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': True|False
}
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy request.
EvaluationResults (list) --
The results of the simulation.
(dict) --
Contains the results of a simulation.
This data type is used by the return parameter of `` SimulateCustomPolicy `` and `` SimulatePrincipalPolicy `` .
EvalActionName (string) --
The name of the API operation tested on the indicated resource.
EvalResourceName (string) --
The ARN of the resource that the indicated API operation was tested on.
EvalDecision (string) --
The result of the simulation.
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this scenario. Remember that even if multiple statements allow the operation on the resource, if only one statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when the resource in a simulation is "*", either explicitly, or when the ResourceArns parameter blank. If you include a list of resources, then any missing context values are instead included under the ResourceSpecificResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
OrganizationsDecisionDetail (dict) --
A structure that details how Organizations and its service control policies affect the results of the simulation. Only applies if the simulated user's account is part of an organization.
AllowedByOrganizations (boolean) --
Specifies whether the simulated operation is allowed by the Organizations service control policies that impact the simulated user's account.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when the boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
EvalDecisionDetails (dict) --
Additional details about the results of the cross-account evaluation decision. This parameter is populated for only cross-account simulations. It contains a brief summary of how each policy type contributes to the final evaluation decision.
If the simulation evaluates policies within the same account and includes a resource ARN, then the parameter is present but the response is empty. If the simulation evaluates policies within the same account and specifies all resources (* ), then the parameter is not returned.
When you make a cross-account request, Amazon Web Services evaluates the request in the trusting account and the trusted account. The request is allowed only if both evaluations return true . For more information about how policies are evaluated, see Evaluating policies within a single account .
If an Organizations SCP included in the evaluation denies access, the simulation ends. In this case, policy evaluation does not proceed any further and this parameter is not returned.
ResourceSpecificResults (list) --
The individual results of the simulation of the API operation specified in EvalActionName on each resource.
(dict) --
Contains the result of the simulation of a single API operation call on a single resource.
This data type is used by a member of the EvaluationResult data type.
EvalResourceName (string) --
The name of the simulated resource, in Amazon Resource Name (ARN) format.
EvalResourceDecision (string) --
The result of the simulation of the simulated API operation on the resource specified in EvalResourceName .
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if any statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the ResourceArns parameter instead of "*". If you do not specify individual resources, by setting ResourceArns to "*" or by not including the ResourceArns parameter, then any missing context values are instead included under the EvaluationResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
EvalDecisionDetails (dict) --
Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Simulate how a set of IAM policies attached to an IAM entity works with a list of API operations and Amazon Web Services 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 simulate resources that don't exist in your account.
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 operations; it only checks the authorization to determine if the simulated policies allow or deny the operations.
Note: This operation 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 Amazon Web Services 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.
For more information about using the policy simulator, see Testing IAM policies with the IAM policy simulator in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.simulate_principal_policy(
PolicySourceArn='string',
PolicyInputList=[
'string',
],
PermissionsBoundaryPolicyInputList=[
'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'
)
[REQUIRED]
The Amazon Resource Name (ARN) of a user, group, or role whose policies you want to include in the simulation. If you specify a user, group, or role, the simulation includes all policies that are associated with that entity. If you specify a user, the simulation also includes all policies that are attached to any groups the user belongs to.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
An optional list of additional policy documents to include in the simulation. 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 the following:
The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that the entity can have. You can input only one permissions boundary when you pass a policy to this operation. An IAM entity can only have one permissions boundary in effect at a time. For example, if a permissions boundary is attached to an entity and you pass in a different permissions boundary policy using this parameter, then the new permissions boundary policy is used for the simulation. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide . The policy input is specified as a string containing the complete, valid JSON text of a permissions boundary policy.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
A list of names of API operations to evaluate in the simulation. Each operation is evaluated for each resource. Each operation must include the service identifier, such as iam:CreateUser .
A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to * (all resources). Each API in the ActionNames parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.
The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the ResourcePolicy parameter.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The ARN of the IAM user that you want to specify as the simulated caller of the API operations. If you do not specify a CallerArn , it defaults to the ARN of the user that you specify in PolicySourceArn , if you specified a user. If you include both a PolicySourceArn (for example, arn:aws:iam::123456789012:user/David ) and a CallerArn (for example, arn:aws:iam::123456789012:user/Bob ), the result is that you simulate calling the API operations as Bob, as if Bob had David's policies.
You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.
CallerArn is required if you include a ResourcePolicy and the PolicySourceArn is not the ARN for an IAM user. This is required so that the resource-based policy's Principal element has a value to use in evaluating the policy.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.
Contains information about a condition context key. It includes the name of the key and specifies the value (or values, if the context key supports multiple values) to use in the simulation. This information is used when evaluating the Condition elements of the input policies.
This data type is used as an input parameter to SimulateCustomPolicy and SimulatePrincipalPolicy .
The full name of a condition context key, including the service prefix. For example, aws:SourceIp or s3:VersionId .
The value (or values, if the condition context key supports multiple values) to provide to the simulation when the key is referenced by a Condition element in an input policy.
The data type of the value (or values) specified in the ContextKeyValues parameter.
Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.
Each of the EC2 scenarios requires that you specify instance, image, and security group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the EC2 scenario includes VPC, then you must supply the network interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the EC2 scenario options, see Supported platforms in the Amazon EC2 User Guide .
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
dict
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
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': 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'
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': True|False
}
},
]
},
],
'IsTruncated': True|False,
'Marker': 'string'
}
Response Structure
(dict) --
Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy request.
EvaluationResults (list) --
The results of the simulation.
(dict) --
Contains the results of a simulation.
This data type is used by the return parameter of `` SimulateCustomPolicy `` and `` SimulatePrincipalPolicy `` .
EvalActionName (string) --
The name of the API operation tested on the indicated resource.
EvalResourceName (string) --
The ARN of the resource that the indicated API operation was tested on.
EvalDecision (string) --
The result of the simulation.
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this scenario. Remember that even if multiple statements allow the operation on the resource, if only one statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when the resource in a simulation is "*", either explicitly, or when the ResourceArns parameter blank. If you include a list of resources, then any missing context values are instead included under the ResourceSpecificResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
OrganizationsDecisionDetail (dict) --
A structure that details how Organizations and its service control policies affect the results of the simulation. Only applies if the simulated user's account is part of an organization.
AllowedByOrganizations (boolean) --
Specifies whether the simulated operation is allowed by the Organizations service control policies that impact the simulated user's account.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when the boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
EvalDecisionDetails (dict) --
Additional details about the results of the cross-account evaluation decision. This parameter is populated for only cross-account simulations. It contains a brief summary of how each policy type contributes to the final evaluation decision.
If the simulation evaluates policies within the same account and includes a resource ARN, then the parameter is present but the response is empty. If the simulation evaluates policies within the same account and specifies all resources (* ), then the parameter is not returned.
When you make a cross-account request, Amazon Web Services evaluates the request in the trusting account and the trusted account. The request is allowed only if both evaluations return true . For more information about how policies are evaluated, see Evaluating policies within a single account .
If an Organizations SCP included in the evaluation denies access, the simulation ends. In this case, policy evaluation does not proceed any further and this parameter is not returned.
ResourceSpecificResults (list) --
The individual results of the simulation of the API operation specified in EvalActionName on each resource.
(dict) --
Contains the result of the simulation of a single API operation call on a single resource.
This data type is used by a member of the EvaluationResult data type.
EvalResourceName (string) --
The name of the simulated resource, in Amazon Resource Name (ARN) format.
EvalResourceDecision (string) --
The result of the simulation of the simulated API operation on the resource specified in EvalResourceName .
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if any statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the ResourceArns parameter instead of "*". If you do not specify individual resources, by setting ResourceArns to "*" or by not including the ResourceArns parameter, then any missing context values are instead included under the EvaluationResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
EvalDecisionDetails (dict) --
Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
Marker (string) --
When IsTruncated is true , this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Exceptions
Adds one or more tags to an IAM instance profile. If a tag with the same key name already exists, then that tag is overwritten with the new value.
Each tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_instance_profile(
InstanceProfileName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the IAM instance profile to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM instance profile. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an IAM virtual multi-factor authentication (MFA) device. If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_mfa_device(
SerialNumber='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The unique identifier for the IAM virtual MFA device to which you want to add tags. For virtual MFA devices, the serial number is the same as the ARN.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM virtual MFA device. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an OpenID Connect (OIDC)-compatible identity provider. For more information about these providers, see About web identity federation . If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_open_id_connect_provider(
OpenIDConnectProviderArn='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The ARN of the OIDC identity provider in IAM to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the OIDC identity provider in IAM. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an IAM customer managed policy. If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_policy(
PolicyArn='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The ARN of the IAM customer managed policy to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM customer managed policy. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an IAM role. The role can be a regular role or a service-linked role. If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
For more information about tagging, see Tagging IAM identities in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.tag_role(
RoleName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the IAM role to which you want to add tags.
This parameter accepts (through its regex pattern ) a string of characters that consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM role. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to a Security Assertion Markup Language (SAML) identity provider. For more information about these providers, see About SAML 2.0-based federation . If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_saml_provider(
SAMLProviderArn='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The ARN of the SAML identity provider in IAM to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the SAML identity provider in IAM. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an IAM server certificate. If a tag with the same key name already exists, then that tag is overwritten with the new value.
Note
For certificates in a Region supported by Certificate Manager (ACM), we recommend that you don't use IAM server certificates. Instead, use ACM to provision, manage, and deploy your server certificates. For more information about IAM server certificates, Working with server certificates in the IAM User Guide .
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
See also: AWS API Documentation
Request Syntax
response = client.tag_server_certificate(
ServerCertificateName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the IAM server certificate to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM server certificate. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Adds one or more tags to an IAM user. If a tag with the same key name already exists, then that tag is overwritten with the new value.
A tag consists of a key name and an associated value. By assigning tags to your resources, you can do the following:
Note
For more information about tagging, see Tagging IAM identities in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.tag_user(
UserName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the IAM user to which you want to add tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The list of tags that you want to attach to the IAM user. Each tag consists of a key name and an associated value.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
None
Exceptions
Removes the specified tags from the IAM instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_instance_profile(
InstanceProfileName='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The name of the IAM instance profile from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified instance profile.
None
Exceptions
Removes the specified tags from the IAM virtual multi-factor authentication (MFA) device. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_mfa_device(
SerialNumber='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The unique identifier for the IAM virtual MFA device from which you want to remove tags. For virtual MFA devices, the serial number is the same as the ARN.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified instance profile.
None
Exceptions
Removes the specified tags from the specified OpenID Connect (OIDC)-compatible identity provider in IAM. For more information about OIDC providers, see About web identity federation . For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_open_id_connect_provider(
OpenIDConnectProviderArn='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The ARN of the OIDC provider in IAM from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified OIDC provider.
None
Exceptions
Removes the specified tags from the customer managed policy. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_policy(
PolicyArn='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The ARN of the IAM customer managed policy from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified policy.
None
Exceptions
Removes the specified tags from the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_role(
RoleName='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The name of the IAM role from which you want to remove tags.
This parameter accepts (through its regex pattern ) a string of characters that consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified role.
None
Exceptions
Removes the specified tags from the specified Security Assertion Markup Language (SAML) identity provider in IAM. For more information about these providers, see About web identity federation . For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_saml_provider(
SAMLProviderArn='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The ARN of the SAML identity provider in IAM from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified SAML identity provider.
None
Exceptions
Removes the specified tags from the IAM server certificate. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
For certificates in a Region supported by Certificate Manager (ACM), we recommend that you don't use IAM server certificates. Instead, use ACM to provision, manage, and deploy your server certificates. For more information about IAM server certificates, Working with server certificates in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_server_certificate(
ServerCertificateName='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The name of the IAM server certificate from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified IAM server certificate.
None
Exceptions
Removes the specified tags from the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.untag_user(
UserName='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The name of the IAM user from which you want to remove tags.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
A list of key names as a simple array of strings. The tags with matching keys are removed from the specified user.
None
Exceptions
Changes the status of the specified access key from Active to Inactive, or vice versa. This operation can be used to disable a user's key as part of a key rotation workflow.
If the UserName is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the 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'
)
The name of the user whose key you want to update.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The access key ID of the secret access key you want to update.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
[REQUIRED]
The status you want to assign to the secret access key. Active means that the key can be used for programmatic calls to Amazon Web Services, while Inactive means that the key cannot be used.
None
Exceptions
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': {
'...': '...',
},
}
Updates the password policy settings for the account.
Note
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
)
The minimum number of characters allowed in an IAM user password.
If you do not specify a value for this parameter, then the operation uses the default value of 6 .
Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one symbol character.
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one numeric character.
Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one uppercase character.
Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one lowercase character.
Allows all IAM users in your account to use the Management Console to change their own passwords. For more information, see Letting IAM users change their own passwords in the IAM User Guide .
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users in the account do not automatically have permissions to change their own password.
The number of days that an IAM user password is valid.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM user passwords never expire.
Specifies the number of previous passwords that IAM users are prevented from reusing.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM users are not prevented from reusing previous passwords.
Prevents IAM users from setting a new password after their password has expired. The IAM user cannot be accessed until an administrator resets the password.
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users can change their passwords after they expire and continue to sign in as the user.
None
Exceptions
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': {
'...': '...',
},
}
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, see 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'
)
[REQUIRED]
The name of the role to update with the new policy.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy that grants an entity permission to assume the role.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
None
Exceptions
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': {
'...': '...',
},
}
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
The person making the request (the principal), must have permission to change the role group with the old name and the new name. For example, to change the group named Managers to MGRs , the principal must have a policy that allows them to update both groups. If the principal has permission to update the Managers group, but not the MGRs group, then the update fails. For more information about permissions, see Access management .
See also: AWS API Documentation
Request Syntax
response = client.update_group(
GroupName='string',
NewPath='string',
NewGroupName='string'
)
[REQUIRED]
Name of the IAM group to update. If you're changing the name of the group, this is the original name.
This parameter allows (through 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: _+=,.@-
New path for the IAM group. Only include this if changing the group's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
New name for the IAM group. Only include this if changing the group's name.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
None
Exceptions
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': {
'...': '...',
},
}
Changes the password for the specified IAM user. You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. Use ChangePassword to change your own password in the My Security Credentials page in the Management Console.
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
)
[REQUIRED]
The name of the user whose password you want to update.
This parameter allows (through 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: _+=,.@-
The new password for the specified IAM user.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
However, the format can be further restricted by the account administrator by setting a password policy on the account. For more information, see UpdateAccountPasswordPolicy .
None
Exceptions
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': {
'...': '...',
},
}
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 operation 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
Trust for the OIDC provider is derived from the provider's certificate and is validated by the thumbprint. Therefore, it is best to limit access to the UpdateOpenIDConnectProviderThumbprint operation to highly privileged users.
See also: AWS API Documentation
Request Syntax
response = client.update_open_id_connect_provider_thumbprint(
OpenIDConnectProviderArn='string',
ThumbprintList=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM OIDC provider resource object for which you want to update the thumbprint. You can get a list of OIDC provider ARNs by using the ListOpenIDConnectProviders operation.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
[REQUIRED]
A list of certificate thumbprints that are associated with the specified IAM OpenID Connect provider. For more information, see CreateOpenIDConnectProvider .
Contains a thumbprint for an identity provider's server certificate.
The identity provider's server certificate thumbprint is the hex-encoded SHA-1 hash value of the self-signed X.509 certificate. This thumbprint is used by the domain where the OpenID Connect provider makes its keys available. The thumbprint is always a 40-character string.
None
Exceptions
Updates the description or maximum session duration setting of a role.
See also: AWS API Documentation
Request Syntax
response = client.update_role(
RoleName='string',
Description='string',
MaxSessionDuration=123
)
[REQUIRED]
The name of the role that you want to modify.
The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours.
Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide .
dict
Response Syntax
{}
Response Structure
Exceptions
Use UpdateRole instead.
Modifies only the description of a role. This operation performs the same function as the Description parameter in the UpdateRole operation.
See also: AWS API Documentation
Request Syntax
response = client.update_role_description(
RoleName='string',
Description='string'
)
[REQUIRED]
The name of the role that you want to modify.
[REQUIRED]
The new description that you want to apply to the specified role.
dict
Response Syntax
{
'Role': {
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
}
}
Response Structure
(dict) --
Role (dict) --
A structure that contains details about the modified role.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Exceptions
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'
)
[REQUIRED]
An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.
[REQUIRED]
The Amazon Resource Name (ARN) of the SAML provider to update.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
dict
Response Syntax
{
'SAMLProviderArn': 'string'
}
Response Structure
(dict) --
Contains the response to a successful UpdateSAMLProvider request.
SAMLProviderArn (string) --
The Amazon Resource Name (ARN) of the SAML provider that was updated.
Exceptions
Updates the name and/or the path of the specified server certificate stored in IAM.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic also includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
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
The person making the request (the principal), must have permission to change the server certificate with the old name and the new name. For example, to change the certificate named ProductionCert to ProdCert , the principal must have a policy that allows them to update both certificates. If the principal has permission to update the ProductionCert group, but not the ProdCert certificate, then the update fails. 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'
)
[REQUIRED]
The name of the server certificate that you want to update.
This parameter allows (through 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: _+=,.@-
The new path for the server certificate. Include this only if you are updating the server certificate's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The new name for the server certificate. Include this only if you are updating the server certificate's name. The name of the certificate cannot contain any spaces.
This parameter allows (through 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: _+=,.@-
None
Exceptions
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 operation 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'
)
The name of the IAM user associated with the service-specific credential. If you do not specify this value, then the operation assumes the user whose credentials are used to call the operation.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier of the service-specific credential.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
[REQUIRED]
The status to be assigned to the service-specific credential.
None
Exceptions
Changes the status of the specified user signing certificate from active to disabled, or vice versa. This operation 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 user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = client.update_signing_certificate(
UserName='string',
CertificateId='string',
Status='Active'|'Inactive'
)
The name of the IAM user the signing certificate belongs to.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The ID of the signing certificate you want to update.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
[REQUIRED]
The status you want to assign to the certificate. Active means that the certificate can be used for programmatic calls to Amazon Web Services Inactive means that the certificate cannot be used.
None
Exceptions
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': {
'...': '...',
},
}
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 operation 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 operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.update_ssh_public_key(
UserName='string',
SSHPublicKeyId='string',
Status='Active'|'Inactive'
)
[REQUIRED]
The name of the IAM user associated with the SSH public key.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The unique identifier for the SSH public key.
This parameter allows (through its regex pattern ) a string of characters that can consist of any upper or lowercased letter or digit.
[REQUIRED]
The status to assign to the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used.
None
Exceptions
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'
)
[REQUIRED]
Name of the user to update. If you're changing the name of the user, this is the original user name.
This parameter allows (through 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: _+=,.@-
New path for the IAM user. Include this parameter only if you're changing the user's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
New name for the user. Include this parameter only if you're changing the user's name.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
None
Exceptions
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': {
'...': '...',
},
}
Uploads a server certificate entity for the 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 Certificate Manager to provision, manage, and deploy your server certificates. With ACM you can request a certificate, deploy it to Amazon Web Services resources, and let ACM handle certificate renewals for you. Certificates provided by ACM are free. For more information about using ACM, see the Certificate Manager User Guide .
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
For information about the number of server certificates you can upload, see IAM and STS quotas 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, see Signing Amazon Web Services API requests in the Amazon Web Services General Reference . For general information about using the Query API with IAM, see 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',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Note
If you are uploading a server certificate specifically for use with Amazon CloudFront distributions, you must specify a path using the path parameter. The path must begin with /cloudfront and must include a trailing slash (for example, /cloudfront/test/ ).
[REQUIRED]
The name for the server certificate. Do not include the path in this value. The name of the certificate cannot contain any spaces.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The contents of the public key certificate in PEM-encoded format.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
The contents of the private key in PEM-encoded format.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
A list of tags that you want to attach to the new IAM server certificate resource. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
dict
Response Syntax
{
'ServerCertificateMetadata': {
'Path': 'string',
'ServerCertificateName': 'string',
'ServerCertificateId': 'string',
'Arn': 'string',
'UploadDate': datetime(2015, 1, 1),
'Expiration': datetime(2015, 1, 1)
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
(dict) --
Contains the response to a successful UploadServerCertificate request.
ServerCertificateMetadata (dict) --
The meta information of the uploaded server certificate without its certificate body, certificate chain, and private key.
Path (string) --
The path to the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
ServerCertificateName (string) --
The name that identifies the server certificate.
ServerCertificateId (string) --
The stable and unique string identifying the server certificate. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the server certificate. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
UploadDate (datetime) --
The date when the server certificate was uploaded.
Expiration (datetime) --
The date on which the certificate is set to expire.
Tags (list) --
A list of tags that are attached to the new IAM server certificate. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Exceptions
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': {
'...': '...',
},
}
Uploads an X.509 signing certificate and associates it with the specified IAM user. Some Amazon Web Services services require you to use certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is Active .
For information about when you would use an X.509 signing certificate, see Managing server certificates in IAM in the IAM User Guide .
If the UserName is not specified, the IAM user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
Note
Because the body of an 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, see Signing Amazon Web Services API requests in the Amazon Web Services General Reference . For general information about using the Query API with IAM, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.upload_signing_certificate(
UserName='string',
CertificateBody='string'
)
The name of the user the signing certificate is for.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The contents of the signing certificate.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
dict
Response Syntax
{
'Certificate': {
'UserName': 'string',
'CertificateId': 'string',
'CertificateBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful UploadSigningCertificate request.
Certificate (dict) --
Information about the certificate.
UserName (string) --
The name of the user the signing certificate is associated with.
CertificateId (string) --
The ID for the signing certificate.
CertificateBody (string) --
The contents of the signing certificate.
Status (string) --
The status of the signing certificate. Active means that the key is valid for API calls, while Inactive means it is not.
UploadDate (datetime) --
The date when the signing certificate was uploaded.
Exceptions
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': {
'...': '...',
},
}
Uploads an SSH public key and associates it with the specified IAM user.
The SSH public key uploaded by this operation can be used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide .
See also: AWS API Documentation
Request Syntax
response = client.upload_ssh_public_key(
UserName='string',
SSHPublicKeyBody='string'
)
[REQUIRED]
The name of the IAM user to associate the SSH public key with.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. The minimum bit-length of the public key is 2048 bits. For example, you can generate a 2048-bit key, and the resulting PEM file is 1679 bytes long.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
dict
Response Syntax
{
'SSHPublicKey': {
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Fingerprint': 'string',
'SSHPublicKeyBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the response to a successful UploadSSHPublicKey request.
SSHPublicKey (dict) --
Contains information about the SSH public key.
UserName (string) --
The name of the IAM user associated with the SSH public key.
SSHPublicKeyId (string) --
The unique identifier for the SSH public key.
Fingerprint (string) --
The MD5 message digest of the SSH public key.
SSHPublicKeyBody (string) --
The SSH public key.
Status (string) --
The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used.
UploadDate (datetime) --
The date and time, in ISO 8601 date-time format , when the SSH public key was uploaded.
Exceptions
The available paginators are:
paginator = client.get_paginator('get_account_authorization_details')
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'
}
)
A list of entity types used to filter the results. Only the entities that match the types you specify are included in the output. Use the value LocalManagedPolicy to include customer managed policies.
The format for this parameter is a comma-separated (if more than one) list of strings. Each string value in the list must be one of the valid values listed below.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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'
},
],
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': '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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'RolePolicyList': [
{
'PolicyName': 'string',
'PolicyDocument': 'string'
},
],
'AttachedManagedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 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
(dict) --
Contains the response to a successful GetAccountAuthorizationDetails request.
UserDetailList (list) --
A list containing information about IAM users.
(dict) --
Contains information about an IAM user, including all the user's policies and all the IAM groups the user is in.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
UserPolicyList (list) --
A list of the inline policies embedded in the user.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
GroupList (list) --
A list of IAM groups that the user is in.
AttachedManagedPolicies (list) --
A list of the managed policies attached to the user.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the user.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
GroupDetailList (list) --
A list containing information about IAM groups.
(dict) --
Contains information about an IAM group, including all of the group's policies.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
GroupPolicyList (list) --
A list of the inline policies embedded in the group.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
AttachedManagedPolicies (list) --
A list of the managed policies attached to the group.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
RoleDetailList (list) --
A list containing information about IAM roles.
(dict) --
Contains information about an IAM role, including all of the role's policies.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The trust policy that grants permission to assume the role.
InstanceProfileList (list) --
A list of instance profiles that contain this role.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RolePolicyList (list) --
A list of inline policies embedded in the role. These policies are the role's access (permissions) policies.
(dict) --
Contains information about an IAM policy, including the policy document.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
PolicyName (string) --
The name of the policy.
PolicyDocument (string) --
The policy document.
AttachedManagedPolicies (list) --
A list of managed policies attached to the role. These policies are the role's access (permissions) policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Policies (list) --
A list containing information about managed policies.
(dict) --
Contains information about a managed policy, including the policy's ARN, versions, and the number of principal entities (users, groups, and roles) that the policy is attached to.
This data type is used as a response element in the GetAccountAuthorizationDetails operation.
For more information about managed policies, see Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name (not ARN) identifying the policy.
PolicyId (string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Path (string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
DefaultVersionId (string) --
The identifier for the version of the policy that is set as the default (operative) version.
For more information about policy versions, see Versioning for managed policies in the IAM User Guide .
AttachmentCount (integer) --
The number of principal entities (users, groups, and roles) that the policy is attached to.
PermissionsBoundaryUsageCount (integer) --
The number of entities (users and roles) for which the policy is used as the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
IsAttachable (boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
Description (string) --
A friendly description of the policy.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
UpdateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
PolicyVersionList (list) --
A list containing information about the versions of the policy.
(dict) --
Contains information about a version of a managed policy.
This data type is used as a response element in the CreatePolicyVersion , GetPolicyVersion , ListPolicyVersions , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('get_group')
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'
}
)
[REQUIRED]
The name of the group.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful GetGroup request.
Group (dict) --
A structure that contains details about the group.
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
Users (list) --
A list of users in the group.
(dict) --
Contains information about an IAM user entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_access_keys')
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'
}
)
The name of the user.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AccessKeyMetadata': [
{
'UserName': 'string',
'AccessKeyId': 'string',
'Status': 'Active'|'Inactive',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAccessKeys request.
AccessKeyMetadata (list) --
A list of objects containing metadata about the access keys.
(dict) --
Contains information about an Amazon Web Services access key, without its secret key.
This data type is used as a response element in the ListAccessKeys operation.
UserName (string) --
The name of the IAM user that the key is associated with.
AccessKeyId (string) --
The ID for this access key.
Status (string) --
The status of the access key. Active means that the key is valid for API calls; Inactive means it is not.
CreateDate (datetime) --
The date when the access key was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_account_aliases')
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'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'AccountAliases': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
Contains the response to a successful ListAccountAliases request.
A list of aliases associated with the account. Amazon Web Services supports only one alias per account.
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
A token to resume pagination.
paginator = client.get_paginator('list_attached_group_policies')
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'
}
)
[REQUIRED]
The name (friendly name, not ARN) of the group to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedGroupPolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_attached_role_policies')
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'
}
)
[REQUIRED]
The name (friendly name, not ARN) of the role to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedRolePolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_attached_user_policies')
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'
}
)
[REQUIRED]
The name (friendly name, not ARN) of the user to list attached policies for.
This parameter allows (through 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: _+=,.@-
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AttachedPolicies': [
{
'PolicyName': 'string',
'PolicyArn': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListAttachedUserPolicies request.
AttachedPolicies (list) --
A list of the attached policies.
(dict) --
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies , ListAttachedRolePolicies , ListAttachedUserPolicies , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name of the attached policy.
PolicyArn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_entities_for_policy')
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',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
The entity type to use for filtering the results.
For example, when EntityFilter is Role , only the roles that are attached to the specified policy are returned. This parameter is optional. If it is not included, all attached entities (users, groups, and roles) are returned. The argument for this parameter must be one of the valid values listed below.
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PolicyGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'PolicyUsers': [
{
'UserName': 'string',
'UserId': 'string'
},
],
'PolicyRoles': [
{
'RoleName': 'string',
'RoleId': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListEntitiesForPolicy request.
PolicyGroups (list) --
A list of IAM groups that the policy is attached to.
(dict) --
Contains information about a group that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
GroupName (string) --
The name (friendly name, not ARN) identifying the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
PolicyUsers (list) --
A list of IAM users that the policy is attached to.
(dict) --
Contains information about a user that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
UserName (string) --
The name (friendly name, not ARN) identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
PolicyRoles (list) --
A list of IAM roles that the policy is attached to.
(dict) --
Contains information about a role that a managed policy is attached to.
This data type is used as a response element in the ListEntitiesForPolicy operation.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
RoleName (string) --
The name (friendly name, not ARN) identifying the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_group_policies')
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'
}
)
[REQUIRED]
The name of the group to list policies for.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroupPolicies request.
PolicyNames (list) --
A list of policy names.
This parameter allows (through 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: _+=,.@-
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_groups')
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'
}
)
The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ gets all groups whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all groups. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroups request.
Groups (list) --
A list of groups.
(dict) --
Contains information about an IAM group entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_groups_for_user')
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'
}
)
[REQUIRED]
The name of the user to list groups for.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Groups': [
{
'Path': 'string',
'GroupName': 'string',
'GroupId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListGroupsForUser request.
Groups (list) --
A list of groups.
(dict) --
Contains information about an IAM group entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
GroupName (string) --
The friendly name that identifies the group.
GroupId (string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_instance_profiles')
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'
}
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all instance profiles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all instance profiles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListInstanceProfiles request.
InstanceProfiles (list) --
A list of instance profiles.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_instance_profiles_for_role')
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'
}
)
[REQUIRED]
The name of the role to list instance profiles for.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListInstanceProfilesForRole request.
InstanceProfiles (list) --
A list of instance profiles.
(dict) --
Contains information about an instance profile.
This data type is used as a response element in the following operations:
Path (string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
InstanceProfileName (string) --
The name identifying the instance profile.
InstanceProfileId (string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
CreateDate (datetime) --
The date when the instance profile was created.
Roles (list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_mfa_devices')
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'
}
)
The name of the user whose MFA devices you want to list.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'MFADevices': [
{
'UserName': 'string',
'SerialNumber': 'string',
'EnableDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListMFADevices request.
MFADevices (list) --
A list of MFA devices.
(dict) --
Contains information about an MFA device.
This data type is used as a response element in the ListMFADevices operation.
UserName (string) --
The user with whom the MFA device is associated.
SerialNumber (string) --
The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.
EnableDate (datetime) --
The date when the MFA device was enabled for the user.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_policies')
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',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The scope to use for filtering the results.
To list only Amazon Web Services managed policies, set Scope to AWS . To list only the customer managed policies in your account, set Scope to Local .
This parameter is optional. If it is not included, or if it is set to All , all policies are returned.
A flag to filter the results to only the attached policies.
When OnlyAttached is true , the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached is false , or when the parameter is not included, all policies are returned.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Policies': [
{
'PolicyName': 'string',
'PolicyId': 'string',
'Arn': 'string',
'Path': 'string',
'DefaultVersionId': 'string',
'AttachmentCount': 123,
'PermissionsBoundaryUsageCount': 123,
'IsAttachable': True|False,
'Description': 'string',
'CreateDate': datetime(2015, 1, 1),
'UpdateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListPolicies request.
Policies (list) --
A list of policies.
(dict) --
Contains information about a managed policy.
This data type is used as a response element in the CreatePolicy , GetPolicy , and ListPolicies operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
PolicyName (string) --
The friendly name (not ARN) identifying the policy.
PolicyId (string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Path (string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
DefaultVersionId (string) --
The identifier for the version of the policy that is set as the default version.
AttachmentCount (integer) --
The number of entities (users, groups, and roles) that the policy is attached to.
PermissionsBoundaryUsageCount (integer) --
The number of entities (users and roles) for which the policy is used to set the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
IsAttachable (boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
Description (string) --
A friendly description of the policy.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
UpdateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
Tags (list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_policy_versions')
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'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Versions': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListPolicyVersions request.
Versions (list) --
A list of policy versions.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
(dict) --
Contains information about a version of a managed policy.
This data type is used as a response element in the CreatePolicyVersion , GetPolicyVersion , ListPolicyVersions , and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1 .
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_role_policies')
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'
}
)
[REQUIRED]
The name of the role to list policies for.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListRolePolicies request.
PolicyNames (list) --
A list of policy names.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_roles')
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'
}
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all roles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all roles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Roles': [
{
'Path': 'string',
'RoleName': 'string',
'RoleId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'AssumeRolePolicyDocument': 'string',
'Description': 'string',
'MaxSessionDuration': 123,
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'RoleLastUsed': {
'LastUsedDate': datetime(2015, 1, 1),
'Region': 'string'
}
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListRoles request.
Roles (list) --
A list of roles.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_ssh_public_keys')
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'
}
)
The name of the IAM user to list SSH public keys for. If none is specified, the UserName field is determined implicitly based on the Amazon Web Services access key used to sign the request.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SSHPublicKeys': [
{
'UserName': 'string',
'SSHPublicKeyId': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListSSHPublicKeys request.
SSHPublicKeys (list) --
A list of the SSH public keys assigned to IAM user.
(dict) --
Contains information about an SSH public key, without the key's body or fingerprint.
This data type is used as a response element in the ListSSHPublicKeys operation.
UserName (string) --
The name of the IAM user associated with the SSH public key.
SSHPublicKeyId (string) --
The unique identifier for the SSH public key.
Status (string) --
The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used.
UploadDate (datetime) --
The date and time, in ISO 8601 date-time format , when the SSH public key was uploaded.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_server_certificates')
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'
}
)
The path prefix for filtering the results. For example: /company/servercerts would get all server certificates for which the path starts with /company/servercerts .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all server certificates. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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
(dict) --
Contains the response to a successful ListServerCertificates request.
ServerCertificateMetadataList (list) --
A list of server certificates.
(dict) --
Contains information about a server certificate without its certificate body, certificate chain, and private key.
This data type is used as a response element in the UploadServerCertificate and ListServerCertificates operations.
Path (string) --
The path to the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
ServerCertificateName (string) --
The name that identifies the server certificate.
ServerCertificateId (string) --
The stable and unique string identifying the server certificate. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the server certificate. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
UploadDate (datetime) --
The date when the server certificate was uploaded.
Expiration (datetime) --
The date on which the certificate is set to expire.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_signing_certificates')
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'
}
)
The name of the IAM user whose signing certificates you want to examine.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Certificates': [
{
'UserName': 'string',
'CertificateId': 'string',
'CertificateBody': 'string',
'Status': 'Active'|'Inactive',
'UploadDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListSigningCertificates request.
Certificates (list) --
A list of the user's signing certificate information.
(dict) --
Contains information about an X.509 signing certificate.
This data type is used as a response element in the UploadSigningCertificate and ListSigningCertificates operations.
UserName (string) --
The name of the user the signing certificate is associated with.
CertificateId (string) --
The ID for the signing certificate.
CertificateBody (string) --
The contents of the signing certificate.
Status (string) --
The status of the signing certificate. Active means that the key is valid for API calls, while Inactive means it is not.
UploadDate (datetime) --
The date when the signing certificate was uploaded.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_user_policies')
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'
}
)
[REQUIRED]
The name of the user to list policies for.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PolicyNames': [
'string',
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListUserPolicies request.
PolicyNames (list) --
A list of policy names.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_user_tags')
Creates an iterator that will paginate through responses from IAM.Client.list_user_tags().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
UserName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The name of the IAM user whose tags you want to see.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Tags (list) --
The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_users')
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'
}
)
The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/ , which would get all user names whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all user names. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Users': [
{
'Path': 'string',
'UserName': 'string',
'UserId': 'string',
'Arn': 'string',
'CreateDate': datetime(2015, 1, 1),
'PasswordLastUsed': datetime(2015, 1, 1),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListUsers request.
Users (list) --
A list of users.
(dict) --
Contains information about an IAM user entity.
This data type is used as a response element in the following operations:
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_virtual_mfa_devices')
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'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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),
'PermissionsBoundary': {
'PermissionsBoundaryType': 'PermissionsBoundaryPolicy',
'PermissionsBoundaryArn': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'EnableDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListVirtualMFADevices request.
VirtualMFADevices (list) --
The list of virtual MFA devices in the current account that match the AssignmentStatus value that was passed in the request.
(dict) --
Contains information about a virtual MFA device.
SerialNumber (string) --
The serial number associated with VirtualMFADevice .
Base32StringSeed (bytes) --
The base32 seed defined as specified in RFC3548 . The Base32StringSeed is base64-encoded.
QRCodePNG (bytes) --
A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String where $virtualMFADeviceName is one of the create call arguments. AccountName is the user name if set (otherwise, the account ID otherwise), and Base32String is the seed in base32 format. The Base32String value is base64-encoded.
User (dict) --
The IAM user associated with this virtual MFA device.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
EnableDate (datetime) --
The date and time on which the virtual MFA device was enabled.
Tags (list) --
A list of tags that are attached to the virtual MFA device. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('simulate_custom_policy')
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',
],
PermissionsBoundaryPolicyInputList=[
'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'
}
)
[REQUIRED]
A list of policy documents to include in the simulation. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. Do not include any resource-based policies in this parameter. Any resource-based policy must be submitted with the ResourcePolicy parameter. The policies cannot be "scope-down" policies, such as you could include in a call to GetFederationToken or one of the AssumeRole API operations. In other words, do not use policies designed to restrict what a user can do while using the temporary credentials.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that an IAM entity can have. You can input only one permissions boundary when you pass a policy to this operation. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide . The policy input is specified as a string that contains the complete, valid JSON text of a permissions boundary policy.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
A list of names of API operations to evaluate in the simulation. Each operation is evaluated against each resource. Each operation must include the service identifier, such as iam:CreateUser . This operation does not support using wildcards (*) in an action name.
A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to * (all resources). Each API in the ActionNames parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.
The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the ResourcePolicy parameter.
If you include a ResourcePolicy , then it must be applicable to all of the resources included in the simulation or you receive an invalid input error.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
An ARN representing the account ID that specifies the owner of any simulated resource that does not identify its owner in the resource ARN. Examples of resource ARNs include an S3 bucket or object. If ResourceOwner is specified, it is also used as the account owner of any ResourcePolicy included in the simulation. If the ResourceOwner parameter is not specified, then the owner of the resources and the resource policy defaults to the account of the identity provided in CallerArn . This parameter is required only if you specify a resource-based policy and account that owns the resource is different from the account that owns the simulated calling user CallerArn .
The ARN for an account uses the following syntax: arn:aws:iam::*AWS-account-ID* :root . For example, to represent the account with the 112233445566 ID, use the following ARN: arn:aws:iam::112233445566-ID:root .
The ARN of the IAM user that you want to use as the simulated caller of the API operations. CallerArn is required if you include a ResourcePolicy so that the policy's Principal element has a value to use in evaluating the policy.
You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.
A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.
Contains information about a condition context key. It includes the name of the key and specifies the value (or values, if the context key supports multiple values) to use in the simulation. This information is used when evaluating the Condition elements of the input policies.
This data type is used as an input parameter to SimulateCustomPolicy and SimulatePrincipalPolicy .
The full name of a condition context key, including the service prefix. For example, aws:SourceIp or s3:VersionId .
The value (or values, if the condition context key supports multiple values) to provide to the simulation when the key is referenced by a Condition element in an input policy.
The data type of the value (or values) specified in the ContextKeyValues parameter.
Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.
Each of the EC2 scenarios requires that you specify instance, image, and security-group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the EC2 scenario includes VPC, then you must supply the network-interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the EC2 scenario options, see Supported platforms in the Amazon EC2 User Guide .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': 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'
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': True|False
}
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy request.
EvaluationResults (list) --
The results of the simulation.
(dict) --
Contains the results of a simulation.
This data type is used by the return parameter of `` SimulateCustomPolicy `` and `` SimulatePrincipalPolicy `` .
EvalActionName (string) --
The name of the API operation tested on the indicated resource.
EvalResourceName (string) --
The ARN of the resource that the indicated API operation was tested on.
EvalDecision (string) --
The result of the simulation.
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this scenario. Remember that even if multiple statements allow the operation on the resource, if only one statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when the resource in a simulation is "*", either explicitly, or when the ResourceArns parameter blank. If you include a list of resources, then any missing context values are instead included under the ResourceSpecificResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
OrganizationsDecisionDetail (dict) --
A structure that details how Organizations and its service control policies affect the results of the simulation. Only applies if the simulated user's account is part of an organization.
AllowedByOrganizations (boolean) --
Specifies whether the simulated operation is allowed by the Organizations service control policies that impact the simulated user's account.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when the boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
EvalDecisionDetails (dict) --
Additional details about the results of the cross-account evaluation decision. This parameter is populated for only cross-account simulations. It contains a brief summary of how each policy type contributes to the final evaluation decision.
If the simulation evaluates policies within the same account and includes a resource ARN, then the parameter is present but the response is empty. If the simulation evaluates policies within the same account and specifies all resources (* ), then the parameter is not returned.
When you make a cross-account request, Amazon Web Services evaluates the request in the trusting account and the trusted account. The request is allowed only if both evaluations return true . For more information about how policies are evaluated, see Evaluating policies within a single account .
If an Organizations SCP included in the evaluation denies access, the simulation ends. In this case, policy evaluation does not proceed any further and this parameter is not returned.
ResourceSpecificResults (list) --
The individual results of the simulation of the API operation specified in EvalActionName on each resource.
(dict) --
Contains the result of the simulation of a single API operation call on a single resource.
This data type is used by a member of the EvaluationResult data type.
EvalResourceName (string) --
The name of the simulated resource, in Amazon Resource Name (ARN) format.
EvalResourceDecision (string) --
The result of the simulation of the simulated API operation on the resource specified in EvalResourceName .
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if any statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the ResourceArns parameter instead of "*". If you do not specify individual resources, by setting ResourceArns to "*" or by not including the ResourceArns parameter, then any missing context values are instead included under the EvaluationResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
EvalDecisionDetails (dict) --
Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('simulate_principal_policy')
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',
],
PermissionsBoundaryPolicyInputList=[
'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'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of a user, group, or role whose policies you want to include in the simulation. If you specify a user, group, or role, the simulation includes all policies that are associated with that entity. If you specify a user, the simulation also includes all policies that are attached to any groups the user belongs to.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
An optional list of additional policy documents to include in the simulation. 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 the following:
The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that the entity can have. You can input only one permissions boundary when you pass a policy to this operation. An IAM entity can only have one permissions boundary in effect at a time. For example, if a permissions boundary is attached to an entity and you pass in a different permissions boundary policy using this parameter, then the new permissions boundary policy is used for the simulation. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide . The policy input is specified as a string containing the complete, valid JSON text of a permissions boundary policy.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
A list of names of API operations to evaluate in the simulation. Each operation is evaluated for each resource. Each operation must include the service identifier, such as iam:CreateUser .
A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to * (all resources). Each API in the ActionNames parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.
The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the ResourcePolicy parameter.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The ARN of the IAM user that you want to specify as the simulated caller of the API operations. If you do not specify a CallerArn , it defaults to the ARN of the user that you specify in PolicySourceArn , if you specified a user. If you include both a PolicySourceArn (for example, arn:aws:iam::123456789012:user/David ) and a CallerArn (for example, arn:aws:iam::123456789012:user/Bob ), the result is that you simulate calling the API operations as Bob, as if Bob had David's policies.
You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.
CallerArn is required if you include a ResourcePolicy and the PolicySourceArn is not the ARN for an IAM user. This is required so that the resource-based policy's Principal element has a value to use in evaluating the policy.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.
Contains information about a condition context key. It includes the name of the key and specifies the value (or values, if the context key supports multiple values) to use in the simulation. This information is used when evaluating the Condition elements of the input policies.
This data type is used as an input parameter to SimulateCustomPolicy and SimulatePrincipalPolicy .
The full name of a condition context key, including the service prefix. For example, aws:SourceIp or s3:VersionId .
The value (or values, if the condition context key supports multiple values) to provide to the simulation when the key is referenced by a Condition element in an input policy.
The data type of the value (or values) specified in the ContextKeyValues parameter.
Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.
Each of the EC2 scenarios requires that you specify instance, image, and security group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the EC2 scenario includes VPC, then you must supply the network interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the EC2 scenario options, see Supported platforms in the Amazon EC2 User Guide .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': 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'
},
'PermissionsBoundaryDecisionDetail': {
'AllowedByPermissionsBoundary': True|False
}
},
]
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy request.
EvaluationResults (list) --
The results of the simulation.
(dict) --
Contains the results of a simulation.
This data type is used by the return parameter of `` SimulateCustomPolicy `` and `` SimulatePrincipalPolicy `` .
EvalActionName (string) --
The name of the API operation tested on the indicated resource.
EvalResourceName (string) --
The ARN of the resource that the indicated API operation was tested on.
EvalDecision (string) --
The result of the simulation.
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this scenario. Remember that even if multiple statements allow the operation on the resource, if only one statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when the resource in a simulation is "*", either explicitly, or when the ResourceArns parameter blank. If you include a list of resources, then any missing context values are instead included under the ResourceSpecificResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
OrganizationsDecisionDetail (dict) --
A structure that details how Organizations and its service control policies affect the results of the simulation. Only applies if the simulated user's account is part of an organization.
AllowedByOrganizations (boolean) --
Specifies whether the simulated operation is allowed by the Organizations service control policies that impact the simulated user's account.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when the boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
EvalDecisionDetails (dict) --
Additional details about the results of the cross-account evaluation decision. This parameter is populated for only cross-account simulations. It contains a brief summary of how each policy type contributes to the final evaluation decision.
If the simulation evaluates policies within the same account and includes a resource ARN, then the parameter is present but the response is empty. If the simulation evaluates policies within the same account and specifies all resources (* ), then the parameter is not returned.
When you make a cross-account request, Amazon Web Services evaluates the request in the trusting account and the trusted account. The request is allowed only if both evaluations return true . For more information about how policies are evaluated, see Evaluating policies within a single account .
If an Organizations SCP included in the evaluation denies access, the simulation ends. In this case, policy evaluation does not proceed any further and this parameter is not returned.
ResourceSpecificResults (list) --
The individual results of the simulation of the API operation specified in EvalActionName on each resource.
(dict) --
Contains the result of the simulation of a single API operation call on a single resource.
This data type is used by a member of the EvaluationResult data type.
EvalResourceName (string) --
The name of the simulated resource, in Amazon Resource Name (ARN) format.
EvalResourceDecision (string) --
The result of the simulation of the simulated API operation on the resource specified in EvalResourceName .
MatchedStatements (list) --
A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if any statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
(dict) --
Contains a reference to a Statement element in a policy document that determines the result of the simulation.
This data type is used by the MatchedStatements member of the `` EvaluationResult `` type.
SourcePolicyId (string) --
The identifier of the policy that was provided as an input.
SourcePolicyType (string) --
The type of the policy.
StartPosition (dict) --
The row and column of the beginning of the Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
EndPosition (dict) --
The row and column of the end of a Statement in an IAM policy.
Line (integer) --
The line containing the specified position in the document.
Column (integer) --
The column in the line containing the specified position in the document.
MissingContextValues (list) --
A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the ResourceArns parameter instead of "*". If you do not specify individual resources, by setting ResourceArns to "*" or by not including the ResourceArns parameter, then any missing context values are instead included under the EvaluationResults section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy .
EvalDecisionDetails (dict) --
Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
PermissionsBoundaryDecisionDetail (dict) --
Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
AllowedByPermissionsBoundary (boolean) --
Specifies whether an action is allowed by a permissions boundary that is applied to an IAM entity (user or role). A value of true means that the permissions boundary does not deny the action. This means that the policy includes an Allow statement that matches the request. In this case, if an identity-based policy also allows the action, the request is allowed. A value of false means that either the requested action is not allowed (implicitly denied) or that the action is explicitly denied by the permissions boundary. In both of these cases, the action is not allowed, regardless of the identity-based policy.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems number of results even when there are more results available. We recommend that you check IsTruncated after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.
The available waiters are:
waiter = client.get_waiter('instance_profile_exists')
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',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The name of the instance profile to get information about.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 1
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('policy_exists')
Polls IAM.Client.get_policy() 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(
PolicyArn='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[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) in the Amazon Web Services General Reference .
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 1
The maximum number of attempts to be made. Default: 20
None
waiter = client.get_waiter('role_exists')
Polls IAM.Client.get_role() 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(
RoleName='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The name of the IAM role to get information about.
This parameter allows (through 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: _+=,.@-
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 1
The maximum number of attempts to be made. Default: 20
None
waiter = client.get_waiter('user_exists')
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',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
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 (through 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: _+=,.@-
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 1
The maximum number of attempts to be made. Default: 20
None
A resource representing AWS Identity and Access Management (IAM):
import boto3
iam = boto3.resource('iam')
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Changes the password of the IAM user who is calling this operation. This operation can be performed using the CLI, the Amazon Web Services API, or the My Security Credentials page in the Management Console. The account root user password is not affected by this operation.
Use UpdateLoginProfile to use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. For more information about modifying passwords, see Managing passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = iam.change_password(
OldPassword='string',
NewPassword='string'
)
[REQUIRED]
The IAM user's current password.
[REQUIRED]
The new password. The new password must conform to the account's password policy, if one exists.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020 ) through the end of the ASCII character range (\u00FF ). You can also include the tab (\u0009 ), line feed (\u000A ), and carriage return (\u000D ) characters. Any of these characters are valid in a password. However, many tools, such as the Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.
None
Creates an alias for your account. For information about using an account alias, see Using an alias for your account ID in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = iam.create_account_alias(
AccountAlias='string'
)
[REQUIRED]
The account alias to create.
This parameter allows (through 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.
Updates the password policy settings for the account.
Note
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
account_password_policy = iam.create_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
)
The minimum number of characters allowed in an IAM user password.
If you do not specify a value for this parameter, then the operation uses the default value of 6 .
Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one symbol character.
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one numeric character.
Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one uppercase character.
Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one lowercase character.
Allows all IAM users in your account to use the Management Console to change their own passwords. For more information, see Letting IAM users change their own passwords in the IAM User Guide .
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users in the account do not automatically have permissions to change their own password.
The number of days that an IAM user password is valid.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM user passwords never expire.
Specifies the number of previous passwords that IAM users are prevented from reusing.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM users are not prevented from reusing previous passwords.
Prevents IAM users from setting a new password after their password has expired. The IAM user cannot be accessed until an administrator resets the password.
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users can change their passwords after they expire and continue to sign in as the user.
iam.AccountPasswordPolicy
AccountPasswordPolicy resource
Creates a new group.
For information about the number of groups you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
group = iam.create_group(
Path='string',
GroupName='string'
)
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the group to create. Do not include the path in this value.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
iam.Group
Group resource
Creates a new instance profile. For information about instance profiles, see Using roles for applications on Amazon EC2 in the IAM User Guide , and Instance profiles in the Amazon EC2 User Guide .
For information about the number of instance profiles you can create, see IAM object quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
instance_profile = iam.create_instance_profile(
InstanceProfileName='string',
Path='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of the instance profile to create.
This parameter allows (through 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: _+=,.@-
The path to the instance profile. For more information about paths, see IAM Identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A list of tags that you want to attach to the newly created IAM instance profile. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.InstanceProfile
InstanceProfile resource
Creates a new managed policy for your 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 .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM 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
policy = iam.create_policy(
PolicyName='string',
Path='string',
PolicyDocument='string',
Description='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The friendly name of the policy.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
The path for the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The JSON policy document that you want to use as the content for the new policy.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
A friendly description of the policy.
Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables."
The policy description is immutable. After a value is assigned, it cannot be changed.
A list of tags that you want to attach to the new IAM customer managed policy. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.Policy
Policy resource
Creates a new role for your account. For more information about roles, see IAM roles . For information about quotas for role names and the number of roles you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
role = iam.create_role(
Path='string',
RoleName='string',
AssumeRolePolicyDocument='string',
Description='string',
MaxSessionDuration=123,
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the role to create.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
[REQUIRED]
The trust relationship policy document that grants an entity permission to assume the role.
In IAM, you must provide a JSON policy that has been converted to a string. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Upon success, the response includes the same trust policy in JSON format.
The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours.
Anyone who assumes the role from the or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide .
A list of tags that you want to attach to the new role. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.Role
Role resource
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. Such a policy can 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 Management Console or one that supports API access to Amazon Web Services.
When you create the SAML provider resource, you upload a SAML metadata document that you get from your IdP. That document 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 Management Console and About SAML 2.0-based federation in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
saml_provider = iam.create_saml_provider(
SAMLMetadataDocument='string',
Name='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.
For more information, see About SAML 2.0-based federation in the IAM User Guide
[REQUIRED]
The name of the provider to create.
This parameter allows (through 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: _+=,.@-
A list of tags that you want to attach to the new IAM SAML provider. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.SamlProvider
SamlProvider resource
Uploads a server certificate entity for the 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 Certificate Manager to provision, manage, and deploy your server certificates. With ACM you can request a certificate, deploy it to Amazon Web Services resources, and let ACM handle certificate renewals for you. Certificates provided by ACM are free. For more information about using ACM, see the Certificate Manager User Guide .
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
For information about the number of server certificates you can upload, see IAM and STS quotas 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, see Signing Amazon Web Services API requests in the Amazon Web Services General Reference . For general information about using the Query API with IAM, see Calling the API by making HTTP query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
server_certificate = iam.create_server_certificate(
Path='string',
ServerCertificateName='string',
CertificateBody='string',
PrivateKey='string',
CertificateChain='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Note
If you are uploading a server certificate specifically for use with Amazon CloudFront distributions, you must specify a path using the path parameter. The path must begin with /cloudfront and must include a trailing slash (for example, /cloudfront/test/ ).
[REQUIRED]
The name for the server certificate. Do not include the path in this value. The name of the certificate cannot contain any spaces.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The contents of the public key certificate in PEM-encoded format.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
[REQUIRED]
The contents of the private key in PEM-encoded format.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
A list of tags that you want to attach to the new IAM server certificate resource. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.ServerCertificate
ServerCertificate resource
Uploads an X.509 signing certificate and associates it with the specified IAM user. Some Amazon Web Services services require you to use certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is Active .
For information about when you would use an X.509 signing certificate, see Managing server certificates in IAM in the IAM User Guide .
If the UserName is not specified, the IAM user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
Note
Because the body of an 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, see Signing Amazon Web Services API requests in the Amazon Web Services General Reference . For general information about using the Query API with IAM, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
signing_certificate = iam.create_signing_certificate(
UserName='string',
CertificateBody='string'
)
The name of the user the signing certificate is for.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The contents of the signing certificate.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
iam.SigningCertificate
SigningCertificate resource
Creates a new IAM user for your account.
For information about quotas for the number of IAM users you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
user = iam.create_user(
Path='string',
UserName='string',
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the user name. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the user to create.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
A list of tags that you want to attach to the new user. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.User
User resource
Creates a new virtual MFA device for the 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, see Using a virtual MFA device in the IAM User Guide .
For information about the maximum number of MFA devices you can create, see IAM and STS quotas 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. In other words, protect the seed information as you would your Amazon Web Services 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
virtual_mfa_device = iam.create_virtual_mfa_device(
Path='string',
VirtualMFADeviceName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the virtual MFA device. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
[REQUIRED]
The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.
This parameter allows (through 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: _+=,.@-
A list of tags that you want to attach to the new IAM virtual MFA device. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.VirtualMfaDevice
VirtualMfaDevice resource
Returns a list of all the available sub-resources for this Resource.
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a AccessKey resource.:
access_key = iam.AccessKey('user_name','id')
A AccessKey resource
Creates a AccessKeyPair resource.:
access_key_pair = iam.AccessKeyPair('user_name','id','secret')
A AccessKeyPair resource
Creates a AccountPasswordPolicy resource.:
account_password_policy = iam.AccountPasswordPolicy()
Creates a AccountSummary resource.:
account_summary = iam.AccountSummary()
Creates a AssumeRolePolicy resource.:
assume_role_policy = iam.AssumeRolePolicy('role_name')
Creates a CurrentUser resource.:
current_user = iam.CurrentUser()
Creates a Group resource.:
group = iam.Group('name')
Creates a GroupPolicy resource.:
group_policy = iam.GroupPolicy('group_name','name')
A GroupPolicy resource
Creates a InstanceProfile resource.:
instance_profile = iam.InstanceProfile('name')
Creates a LoginProfile resource.:
login_profile = iam.LoginProfile('user_name')
Creates a MfaDevice resource.:
mfa_device = iam.MfaDevice('user_name','serial_number')
A MfaDevice resource
Creates a Policy resource.:
policy = iam.Policy('policy_arn')
Creates a PolicyVersion resource.:
policy_version = iam.PolicyVersion('arn','version_id')
A PolicyVersion resource
Creates a Role resource.:
role = iam.Role('name')
Creates a RolePolicy resource.:
role_policy = iam.RolePolicy('role_name','name')
A RolePolicy resource
Creates a SamlProvider resource.:
saml_provider = iam.SamlProvider('arn')
Creates a ServerCertificate resource.:
server_certificate = iam.ServerCertificate('name')
Creates a SigningCertificate resource.:
signing_certificate = iam.SigningCertificate('user_name','id')
A SigningCertificate resource
Creates a User resource.:
user = iam.User('name')
Creates a UserPolicy resource.:
user_policy = iam.UserPolicy('user_name','name')
A UserPolicy resource
Creates a VirtualMfaDevice resource.:
virtual_mfa_device = iam.VirtualMfaDevice('serial_number')
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Group resources.A Group Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = iam.groups.all()
Creates an iterable of all Group resources in the collection filtered by kwargs passed to method.A Group collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
group_iterator = iam.groups.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ gets all groups whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all groups. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Group)
A list of Group resources
Creates an iterable up to a specified amount of Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = iam.groups.limit(
count=123
)
Creates an iterable of all Group resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
group_iterator = iam.groups.page_size(
count=123
)
A collection of InstanceProfile resources.A InstanceProfile Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all InstanceProfile resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = iam.instance_profiles.all()
Creates an iterable of all InstanceProfile resources in the collection filtered by kwargs passed to method.A InstanceProfile collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = iam.instance_profiles.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all instance profiles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all instance profiles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.InstanceProfile)
A list of InstanceProfile resources
Creates an iterable up to a specified amount of InstanceProfile resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = iam.instance_profiles.limit(
count=123
)
Creates an iterable of all InstanceProfile resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = iam.instance_profiles.page_size(
count=123
)
A collection of Policy resources.A Policy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = iam.policies.all()
Creates an iterable of all Policy resources in the collection filtered by kwargs passed to method.A Policy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
policy_iterator = iam.policies.filter(
Scope='All'|'AWS'|'Local',
OnlyAttached=True|False,
PathPrefix='string',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
The scope to use for filtering the results.
To list only Amazon Web Services managed policies, set Scope to AWS . To list only the customer managed policies in your account, set Scope to Local .
This parameter is optional. If it is not included, or if it is set to All , all policies are returned.
A flag to filter the results to only the attached policies.
When OnlyAttached is true , the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached is false , or when the parameter is not included, all policies are returned.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Policy)
A list of Policy resources
Creates an iterable up to a specified amount of Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = iam.policies.limit(
count=123
)
Creates an iterable of all Policy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
policy_iterator = iam.policies.page_size(
count=123
)
A collection of Role resources.A Role Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Role resources in the collection.
See also: AWS API Documentation
Request Syntax
role_iterator = iam.roles.all()
Creates an iterable of all Role resources in the collection filtered by kwargs passed to method.A Role collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
role_iterator = iam.roles.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all roles whose path starts with /application_abc/component_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all roles. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Role)
A list of Role resources
Creates an iterable up to a specified amount of Role resources in the collection.
See also: AWS API Documentation
Request Syntax
role_iterator = iam.roles.limit(
count=123
)
Creates an iterable of all Role resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
role_iterator = iam.roles.page_size(
count=123
)
A collection of SamlProvider resources.A SamlProvider Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all SamlProvider resources in the collection.
See also: AWS API Documentation
Request Syntax
saml_provider_iterator = iam.saml_providers.all()
Creates an iterable of all SamlProvider resources in the collection filtered by kwargs passed to method.A SamlProvider collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
saml_provider_iterator = iam.saml_providers.filter()
Creates an iterable up to a specified amount of SamlProvider resources in the collection.
See also: AWS API Documentation
Request Syntax
saml_provider_iterator = iam.saml_providers.limit(
count=123
)
Creates an iterable of all SamlProvider resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
saml_provider_iterator = iam.saml_providers.page_size(
count=123
)
A collection of ServerCertificate resources.A ServerCertificate Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all ServerCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
server_certificate_iterator = iam.server_certificates.all()
Creates an iterable of all ServerCertificate resources in the collection filtered by kwargs passed to method.A ServerCertificate collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
server_certificate_iterator = iam.server_certificates.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example: /company/servercerts would get all server certificates for which the path starts with /company/servercerts .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all server certificates. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.ServerCertificate)
A list of ServerCertificate resources
Creates an iterable up to a specified amount of ServerCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
server_certificate_iterator = iam.server_certificates.limit(
count=123
)
Creates an iterable of all ServerCertificate resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
server_certificate_iterator = iam.server_certificates.page_size(
count=123
)
A collection of User resources.A User Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = iam.users.all()
Creates an iterable of all User resources in the collection filtered by kwargs passed to method.A User collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
user_iterator = iam.users.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/ , which would get all user names whose path starts with /division_abc/subdivision_xyz/ .
This parameter is optional. If it is not included, it defaults to a slash (/), listing all user names. This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.User)
A list of User resources
Creates an iterable up to a specified amount of User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = iam.users.limit(
count=123
)
Creates an iterable of all User resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
user_iterator = iam.users.page_size(
count=123
)
A collection of VirtualMfaDevice resources.A VirtualMfaDevice Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all VirtualMfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
virtual_mfa_device_iterator = iam.virtual_mfa_devices.all()
Creates an iterable of all VirtualMfaDevice resources in the collection filtered by kwargs passed to method.A VirtualMfaDevice collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
virtual_mfa_device_iterator = iam.virtual_mfa_devices.filter(
AssignmentStatus='Assigned'|'Unassigned'|'Any',
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.VirtualMfaDevice)
A list of VirtualMfaDevice resources
Creates an iterable up to a specified amount of VirtualMfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
virtual_mfa_device_iterator = iam.virtual_mfa_devices.limit(
count=123
)
Creates an iterable of all VirtualMfaDevice resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
virtual_mfa_device_iterator = iam.virtual_mfa_devices.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) AccessKey:
import boto3
iam = boto3.resource('iam')
access_key = iam.AccessKey('user_name','id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The AccessKey's user_name identifier. This must be set.
(string) The AccessKey's id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The ID for this access key.
(datetime) --
The date when the access key was created.
(string) --
The status of the access key. Active means that the key is valid for API calls; Inactive means it is not.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Changes the status of the specified access key from Active to Inactive, or vice versa. This operation can be used to disable a user's key as part of a key rotation workflow.
If the UserName is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the 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 = access_key.activate()
Changes the status of the specified access key from Active to Inactive, or vice versa. This operation can be used to disable a user's key as part of a key rotation workflow.
If the UserName is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the 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 = access_key.deactivate()
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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = access_key.delete()
Returns a list of all the available sub-resources for this Resource.
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) AccessKeyPair:
import boto3
iam = boto3.resource('iam')
access_key_pair = iam.AccessKeyPair('user_name','id','secret')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The AccessKeyPair's user_name identifier. This must be set.
(string) The AccessKeyPair's id identifier. This must be set.
(string) The AccessKeyPair's secret identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The ID for this access key.
(datetime) --
The date when the access key was created.
(string) --
The secret key used to sign requests.
(string) --
The status of the access key. Active means that the key is valid for API calls, while Inactive means it is not.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Changes the status of the specified access key from Active to Inactive, or vice versa. This operation can be used to disable a user's key as part of a key rotation workflow.
If the UserName is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the 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 = access_key_pair.activate()
Changes the status of the specified access key from Active to Inactive, or vice versa. This operation can be used to disable a user's key as part of a key rotation workflow.
If the UserName is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the 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 = access_key_pair.deactivate()
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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = access_key_pair.delete()
Returns a list of all the available sub-resources for this Resource.
A resource representing an AWS Identity and Access Management (IAM) AccountPasswordPolicy:
import boto3
iam = boto3.resource('iam')
account_password_policy = iam.AccountPasswordPolicy()
These are the resource's available attributes:
These are the resource's available actions:
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(boolean) --
Specifies whether IAM users are allowed to change their own password.
(boolean) --
Indicates whether passwords in the account expire. Returns true if MaxPasswordAge contains a value greater than 0. Returns false if MaxPasswordAge is 0 or not present.
(boolean) --
Specifies whether IAM users are prevented from setting a new password after their password has expired.
(integer) --
The number of days that an IAM user password is valid.
(integer) --
Minimum length to require for IAM user passwords.
(integer) --
Specifies the number of previous passwords that IAM users are prevented from reusing.
(boolean) --
Specifies whether IAM user passwords must contain at least one lowercase character (a to z).
(boolean) --
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
(boolean) --
Specifies whether IAM user passwords must contain at least one of the following symbols:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
(boolean) --
Specifies whether IAM user passwords must contain at least one uppercase character (A to Z).
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Deletes the password policy for the account. There are no parameters.
See also: AWS API Documentation
Request Syntax
response = account_password_policy.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_account_password_policy() to update the attributes of the AccountPasswordPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
account_password_policy.load()
Calls IAM.Client.get_account_password_policy() to update the attributes of the AccountPasswordPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
account_password_policy.reload()
Updates the password policy settings for the account.
Note
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 = account_password_policy.update(
MinimumPasswordLength=123,
RequireSymbols=True|False,
RequireNumbers=True|False,
RequireUppercaseCharacters=True|False,
RequireLowercaseCharacters=True|False,
AllowUsersToChangePassword=True|False,
MaxPasswordAge=123,
PasswordReusePrevention=123,
HardExpiry=True|False
)
The minimum number of characters allowed in an IAM user password.
If you do not specify a value for this parameter, then the operation uses the default value of 6 .
Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one symbol character.
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one numeric character.
Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one uppercase character.
Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that passwords do not require at least one lowercase character.
Allows all IAM users in your account to use the Management Console to change their own passwords. For more information, see Letting IAM users change their own passwords in the IAM User Guide .
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users in the account do not automatically have permissions to change their own password.
The number of days that an IAM user password is valid.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM user passwords never expire.
Specifies the number of previous passwords that IAM users are prevented from reusing.
If you do not specify a value for this parameter, then the operation uses the default value of 0 . The result is that IAM users are not prevented from reusing previous passwords.
Prevents IAM users from setting a new password after their password has expired. The IAM user cannot be accessed until an administrator resets the password.
If you do not specify a value for this parameter, then the operation uses the default value of false . The result is that IAM users can change their passwords after they expire and continue to sign in as the user.
None
A resource representing an AWS Identity and Access Management (IAM) AccountSummary:
import boto3
iam = boto3.resource('iam')
account_summary = iam.AccountSummary()
These are the resource's available attributes:
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(dict) --
A set of key–value pairs containing information about IAM entity usage and IAM quotas.
A resource representing an AWS Identity and Access Management (IAM) AssumeRolePolicy:
import boto3
iam = boto3.resource('iam')
assume_role_policy = iam.AssumeRolePolicy('role_name')
These are the resource's available identifiers:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The AssumeRolePolicy's role_name identifier. This must be set.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Returns a list of all the available sub-resources for this Resource.
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, see Using roles to delegate permissions and federate identities .
See also: AWS API Documentation
Request Syntax
response = assume_role_policy.update(
PolicyDocument='string'
)
[REQUIRED]
The policy that grants an entity permission to assume the role.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) CurrentUser:
import boto3
iam = boto3.resource('iam')
current_user = iam.CurrentUser()
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available collections:
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
(datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
(datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
(string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
(dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
(list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
(string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
(string) --
The friendly name identifying the user.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(User) The related user if set, otherwise None.
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of AccessKey resources.A AccessKey Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all AccessKey resources in the collection.
See also: AWS API Documentation
Request Syntax
access_key_iterator = current_user.access_keys.all()
Creates an iterable of all AccessKey resources in the collection filtered by kwargs passed to method.A AccessKey collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
access_key_iterator = current_user.access_keys.filter(
UserName='string',
Marker='string',
MaxItems=123
)
The name of the user.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.AccessKey)
A list of AccessKey resources
Creates an iterable up to a specified amount of AccessKey resources in the collection.
See also: AWS API Documentation
Request Syntax
access_key_iterator = current_user.access_keys.limit(
count=123
)
Creates an iterable of all AccessKey resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
access_key_iterator = current_user.access_keys.page_size(
count=123
)
A collection of MfaDevice resources.A MfaDevice Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all MfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = current_user.mfa_devices.all()
Creates an iterable of all MfaDevice resources in the collection filtered by kwargs passed to method.A MfaDevice collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = current_user.mfa_devices.filter(
UserName='string',
Marker='string',
MaxItems=123
)
The name of the user whose MFA devices you want to list.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.MfaDevice)
A list of MfaDevice resources
Creates an iterable up to a specified amount of MfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = current_user.mfa_devices.limit(
count=123
)
Creates an iterable of all MfaDevice resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = current_user.mfa_devices.page_size(
count=123
)
A collection of SigningCertificate resources.A SigningCertificate Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all SigningCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = current_user.signing_certificates.all()
Creates an iterable of all SigningCertificate resources in the collection filtered by kwargs passed to method.A SigningCertificate collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = current_user.signing_certificates.filter(
UserName='string',
Marker='string',
MaxItems=123
)
The name of the IAM user whose signing certificates you want to examine.
This parameter allows (through 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: _+=,.@-
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.SigningCertificate)
A list of SigningCertificate resources
Creates an iterable up to a specified amount of SigningCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = current_user.signing_certificates.limit(
count=123
)
Creates an iterable of all SigningCertificate resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = current_user.signing_certificates.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) Group:
import boto3
iam = boto3.resource('iam')
group = iam.Group('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Group's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
(datetime) --
The date and time, in ISO 8601 date-time format , when the group was created.
(string) --
The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide .
(string) --
The friendly name that identifies the group.
(string) --
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Adds the specified user to the specified group.
See also: AWS API Documentation
Request Syntax
response = group.add_user(
UserName='string'
)
[REQUIRED]
The name of the user to add.
This parameter allows (through 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: _+=,.@-
Attaches the specified managed policy to the specified IAM group.
You use this operation to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
For more information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = group.attach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Creates a new group.
For information about the number of groups you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
group = group.create(
Path='string',
)
The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
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 the maximum number of inline policies that you can embed in a group, see IAM and STS quotas 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, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
group_policy = group.create_policy(
PolicyName='string',
PolicyDocument='string'
)
[REQUIRED]
The name of the policy document.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to = IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
iam.GroupPolicy
GroupPolicy resource
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 = group.delete()
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 DeleteGroupPolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = group.detach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_group() to update the attributes of the Group resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
group.load()
Calls IAM.Client.get_group() to update the attributes of the Group resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
group.reload()
Removes the specified user from the specified group.
See also: AWS API Documentation
Request Syntax
response = group.remove_user(
UserName='string'
)
[REQUIRED]
The name of the user to remove.
This parameter allows (through 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: _+=,.@-
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
The person making the request (the principal), must have permission to change the role group with the old name and the new name. For example, to change the group named Managers to MGRs , the principal must have a policy that allows them to update both groups. If the principal has permission to update the Managers group, but not the MGRs group, then the update fails. For more information about permissions, see Access management .
See also: AWS API Documentation
Request Syntax
group = group.update(
NewPath='string',
NewGroupName='string'
)
New path for the IAM group. Only include this if changing the group's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
New name for the IAM group. Only include this if changing the group's name.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
iam.Group
Group resource
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a GroupPolicy resource.:
group_policy = group.Policy('name')
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Policy resources.A Policy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = group.attached_policies.all()
Creates an iterable of all Policy resources in the collection filtered by kwargs passed to method.A Policy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
policy_iterator = group.attached_policies.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Policy)
A list of Policy resources
Creates an iterable up to a specified amount of Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = group.attached_policies.limit(
count=123
)
Creates an iterable of all Policy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
policy_iterator = group.attached_policies.page_size(
count=123
)
A collection of GroupPolicy resources.A GroupPolicy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all GroupPolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
group_policy_iterator = group.policies.all()
Creates an iterable of all GroupPolicy resources in the collection filtered by kwargs passed to method.A GroupPolicy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
group_policy_iterator = group.policies.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.GroupPolicy)
A list of GroupPolicy resources
Creates an iterable up to a specified amount of GroupPolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
group_policy_iterator = group.policies.limit(
count=123
)
Creates an iterable of all GroupPolicy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
group_policy_iterator = group.policies.page_size(
count=123
)
A collection of User resources.A User Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = group.users.all()
Creates an iterable of all User resources in the collection filtered by kwargs passed to method.A User collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
user_iterator = group.users.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.User)
A list of User resources
Creates an iterable up to a specified amount of User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = group.users.limit(
count=123
)
Creates an iterable of all User resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
user_iterator = group.users.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) GroupPolicy:
import boto3
iam = boto3.resource('iam')
group_policy = iam.GroupPolicy('group_name','name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The GroupPolicy's group_name identifier. This must be set.
(string) The GroupPolicy's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
(string) --
The name of the policy.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = group_policy.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_group_policy() to update the attributes of the GroupPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
group_policy.load()
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 the maximum number of inline policies that you can embed in a group, see IAM and STS quotas 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, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = group_policy.put(
PolicyDocument='string'
)
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to = IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Calls IAM.Client.get_group_policy() to update the attributes of the GroupPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
group_policy.reload()
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) InstanceProfile:
import boto3
iam = boto3.resource('iam')
instance_profile = iam.InstanceProfile('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The InstanceProfile's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
(datetime) --
The date when the instance profile was created.
(string) --
The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide .
(string) --
The name identifying the instance profile.
(string) --
The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide .
(list) --
The role associated with the instance profile.
(dict) --
Contains information about an IAM role. This structure is returned as a response element in several API operations that interact with roles.
Path (string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
RoleName (string) --
The friendly name that identifies the role.
RoleId (string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
AssumeRolePolicyDocument (string) --
The policy that grants an entity permission to assume the role.
Description (string) --
A description of the role that you provide.
MaxSessionDuration (integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
PermissionsBoundary (dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
RoleLastUsed (dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
(list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(Role) The related roles if set, otherwise None.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role, and this quota cannot be increased. You can remove the existing role and then add a different role to an instance profile. You must then wait for the change to appear across all of Amazon Web Services because of eventual consistency . To force the change, you must disassociate the instance profile and then associate the instance profile , or you can stop your instance and then restart it.
Note
The caller of this operation must be granted the PassRole permission on the IAM role by a permissions policy.
For more information about roles, see Working with roles . For more information about instance profiles, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = instance_profile.add_role(
RoleName='string'
)
[REQUIRED]
The name of the role to add.
This parameter allows (through 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: _+=,.@-
Deletes the specified instance profile. The instance profile must not have an associated role.
Warning
Make sure that 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, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = instance_profile.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_instance_profile() to update the attributes of the InstanceProfile resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
instance_profile.load()
Calls IAM.Client.get_instance_profile() to update the attributes of the InstanceProfile resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
instance_profile.reload()
Removes the specified IAM role from the specified EC2 instance profile.
Warning
Make sure that 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, see Working with roles . For more information about instance profiles, see About instance profiles .
See also: AWS API Documentation
Request Syntax
response = instance_profile.remove_role(
RoleName='string'
)
[REQUIRED]
The name of the role to remove.
This parameter allows (through 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: _+=,.@-
A resource representing an AWS Identity and Access Management (IAM) LoginProfile:
import boto3
iam = boto3.resource('iam')
login_profile = iam.LoginProfile('user_name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The LoginProfile's user_name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(datetime) --
The date when the password for the user was created.
(boolean) --
Specifies whether the user is required to set a new password on next sign-in.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Creates a password for the specified IAM user. A password allows an IAM user to access Amazon Web Services services through the Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to create a password for any IAM user. Use ChangePassword to update your own existing password in the My Security Credentials page in the Management Console.
For more information about managing passwords, see Managing passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
login_profile = login_profile.create(
Password='string',
PasswordResetRequired=True|False
)
[REQUIRED]
The new password for the user.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020 ) through the end of the ASCII character range (\u00FF ). You can also include the tab (\u0009 ), line feed (\u000A ), and carriage return (\u000D ) characters. Any of these characters are valid in a password. However, many tools, such as the Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.
iam.LoginProfile
LoginProfile resource
Deletes the password for the specified IAM user, which terminates the user's ability to access Amazon Web Services services through the Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to delete a password for any IAM user. You can use ChangePassword to update, but not delete, your own password in the My Security Credentials page in the Management Console.
Warning
Deleting a user's password does not prevent a user from accessing Amazon Web Services 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 = login_profile.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_login_profile() to update the attributes of the LoginProfile resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
login_profile.load()
Calls IAM.Client.get_login_profile() to update the attributes of the LoginProfile resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
login_profile.reload()
Changes the password for the specified IAM user. You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. Use ChangePassword to change your own password in the My Security Credentials page in the Management Console.
For more information about modifying passwords, see Managing passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = login_profile.update(
Password='string',
PasswordResetRequired=True|False
)
The new password for the specified IAM user.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
However, the format can be further restricted by the account administrator by setting a password policy on the account. For more information, see UpdateAccountPasswordPolicy .
None
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) MfaDevice:
import boto3
iam = boto3.resource('iam')
mfa_device = iam.MfaDevice('user_name','serial_number')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The MfaDevice's user_name identifier. This must be set.
(string) The MfaDevice's serial_number identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(datetime) --
The date when the MFA device was enabled for the user.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = mfa_device.associate(
AuthenticationCode1='string',
AuthenticationCode2='string'
)
[REQUIRED]
An authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
[REQUIRED]
A subsequent authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
None
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, see Enabling a virtual multi-factor authentication (MFA) device in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = mfa_device.disassociate()
Returns a list of all the available sub-resources for this Resource.
Synchronizes the specified MFA device with its IAM resource object on the Amazon Web Services servers.
For more information about creating and working with virtual MFA devices, see Using a virtual MFA device in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = mfa_device.resync(
AuthenticationCode1='string',
AuthenticationCode2='string'
)
[REQUIRED]
An authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
[REQUIRED]
A subsequent authentication code emitted by the device.
The format for this parameter is a sequence of six digits.
None
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) Policy:
import boto3
iam = boto3.resource('iam')
policy = iam.Policy('arn')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Policy's arn identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(integer) --
The number of entities (users, groups, and roles) that the policy is attached to.
(datetime) --
The date and time, in ISO 8601 date-time format , when the policy was created.
(string) --
The identifier for the version of the policy that is set as the default version.
(string) --
A friendly description of the policy.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
(boolean) --
Specifies whether the policy can be attached to an IAM user, group, or role.
(string) --
The path to the policy.
For more information about paths, see IAM identifiers in the IAM User Guide .
(integer) --
The number of entities (users and roles) for which the policy is used to set the permissions boundary.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
(string) --
The stable and unique string identifying the policy.
For more information about IDs, see IAM identifiers in the IAM User Guide .
(string) --
The friendly name (not ARN) identifying the policy.
(list) --
A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
(datetime) --
The date and time, in ISO 8601 date-time format , when the policy was last updated.
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(PolicyVersion) The related default_version if set, otherwise None.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Attaches the specified managed policy to the specified IAM group.
You use this operation to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
For more information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.attach_group(
GroupName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the group to attach the policy to.
This parameter allows (through 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: _+=,.@-
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 operation 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 .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.attach_role(
RoleName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the role to attach the policy to.
This parameter allows (through 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: _+=,.@-
Attaches the specified managed policy to the specified user.
You use this operation to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
For more information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.attach_user(
UserName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user to attach the policy to.
This parameter allows (through 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: _+=,.@-
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
policy_version = policy.create_version(
PolicyDocument='string',
SetAsDefault=True|False
)
[REQUIRED]
The JSON policy document that you want to use as the content for this new version of the policy.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas .
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Specifies whether to set this version as the policy's default version.
When this parameter is true , the new policy version becomes the operative version. That is, it becomes the version that is in effect for the IAM users, groups, and roles that the policy is attached to.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
iam.PolicyVersion
PolicyVersion resource
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. In addition, you must delete all 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 = policy.delete()
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 DeleteGroupPolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.detach_group(
GroupName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM group to detach the policy from.
This parameter allows (through 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: _+=,.@-
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 DeleteRolePolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.detach_role(
RoleName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM role to detach the policy from.
This parameter allows (through 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: _+=,.@-
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 DeleteUserPolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy.detach_user(
UserName='string',
)
[REQUIRED]
The name (friendly name, not ARN) of the IAM user to detach the policy from.
This parameter allows (through 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 a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_policy() to update the attributes of the Policy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
policy.load()
Calls IAM.Client.get_policy() to update the attributes of the Policy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
policy.reload()
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Group resources.A Group Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = policy.attached_groups.all()
Creates an iterable of all Group resources in the collection filtered by kwargs passed to method.A Group collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
group_iterator = policy.attached_groups.filter(
PathPrefix='string',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Group)
A list of Group resources
Creates an iterable up to a specified amount of Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = policy.attached_groups.limit(
count=123
)
Creates an iterable of all Group resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
group_iterator = policy.attached_groups.page_size(
count=123
)
A collection of Role resources.A Role Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Role resources in the collection.
See also: AWS API Documentation
Request Syntax
role_iterator = policy.attached_roles.all()
Creates an iterable of all Role resources in the collection filtered by kwargs passed to method.A Role collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
role_iterator = policy.attached_roles.filter(
PathPrefix='string',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Role)
A list of Role resources
Creates an iterable up to a specified amount of Role resources in the collection.
See also: AWS API Documentation
Request Syntax
role_iterator = policy.attached_roles.limit(
count=123
)
Creates an iterable of all Role resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
role_iterator = policy.attached_roles.page_size(
count=123
)
A collection of User resources.A User Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = policy.attached_users.all()
Creates an iterable of all User resources in the collection filtered by kwargs passed to method.A User collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
user_iterator = policy.attached_users.filter(
PathPrefix='string',
PolicyUsageFilter='PermissionsPolicy'|'PermissionsBoundary',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The policy usage method to use for filtering the results.
To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy . To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary .
This parameter is optional. If it is not included, all policies are returned.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.User)
A list of User resources
Creates an iterable up to a specified amount of User resources in the collection.
See also: AWS API Documentation
Request Syntax
user_iterator = policy.attached_users.limit(
count=123
)
Creates an iterable of all User resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
user_iterator = policy.attached_users.page_size(
count=123
)
A collection of PolicyVersion resources.A PolicyVersion Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all PolicyVersion resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_version_iterator = policy.versions.all()
Creates an iterable of all PolicyVersion resources in the collection filtered by kwargs passed to method.A PolicyVersion collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
policy_version_iterator = policy.versions.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.PolicyVersion)
A list of PolicyVersion resources
Creates an iterable up to a specified amount of PolicyVersion resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_version_iterator = policy.versions.limit(
count=123
)
Creates an iterable of all PolicyVersion resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
policy_version_iterator = policy.versions.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) PolicyVersion:
import boto3
iam = boto3.resource('iam')
policy_version = iam.PolicyVersion('arn','version_id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The PolicyVersion's arn identifier. This must be set.
(string) The PolicyVersion's version_id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(datetime) --
The date and time, in ISO 8601 date-time format , when the policy version was created.
(string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is 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.
(boolean) --
Specifies whether the policy version is set as the policy's default version.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Deletes the specified version from the specified managed policy.
You cannot delete the default version from a policy using this operation. 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 = policy_version.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_policy_version() to update the attributes of the PolicyVersion resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
policy_version.load()
Calls IAM.Client.get_policy_version() to update the attributes of the PolicyVersion resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
policy_version.reload()
Sets the specified version of the specified policy as the policy's default (operative) version.
This operation 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 ListEntitiesForPolicy .
For information about managed policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = policy_version.set_as_default()
A resource representing an AWS Identity and Access Management (IAM) Role:
import boto3
iam = boto3.resource('iam')
role = iam.Role('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Role's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.
(string) --
The policy that grants an entity permission to assume the role.
(datetime) --
The date and time, in ISO 8601 date-time format , when the role was created.
(string) --
A description of the role that you provide.
(integer) --
The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.
(string) --
The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide .
(dict) --
The ARN of the policy used to set the permissions boundary for the role.
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
(string) --
The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide .
(dict) --
Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide .
LastUsedDate (datetime) --
The date and time, in ISO 8601 date-time format that the role was last used.
This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide .
Region (string) --
The name of the Region in which the role was last used.
(string) --
The friendly name that identifies the role.
(list) --
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 operation 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 .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = role.attach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Deletes the specified role. The role must not have any policies attached. For more information about roles, see Working with roles .
Warning
Make sure that 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 = role.delete()
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 DeleteRolePolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = role.detach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_role() to update the attributes of the Role resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
role.load()
Calls IAM.Client.get_role() to update the attributes of the Role resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
role.reload()
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a AssumeRolePolicy resource.:
assume_role_policy = role.AssumeRolePolicy()
Creates a RolePolicy resource.:
role_policy = role.Policy('name')
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Policy resources.A Policy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = role.attached_policies.all()
Creates an iterable of all Policy resources in the collection filtered by kwargs passed to method.A Policy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
policy_iterator = role.attached_policies.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Policy)
A list of Policy resources
Creates an iterable up to a specified amount of Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = role.attached_policies.limit(
count=123
)
Creates an iterable of all Policy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
policy_iterator = role.attached_policies.page_size(
count=123
)
A collection of InstanceProfile resources.A InstanceProfile Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all InstanceProfile resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = role.instance_profiles.all()
Creates an iterable of all InstanceProfile resources in the collection filtered by kwargs passed to method.A InstanceProfile collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = role.instance_profiles.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.InstanceProfile)
A list of InstanceProfile resources
Creates an iterable up to a specified amount of InstanceProfile resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = role.instance_profiles.limit(
count=123
)
Creates an iterable of all InstanceProfile resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_profile_iterator = role.instance_profiles.page_size(
count=123
)
A collection of RolePolicy resources.A RolePolicy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all RolePolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
role_policy_iterator = role.policies.all()
Creates an iterable of all RolePolicy resources in the collection filtered by kwargs passed to method.A RolePolicy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
role_policy_iterator = role.policies.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.RolePolicy)
A list of RolePolicy resources
Creates an iterable up to a specified amount of RolePolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
role_policy_iterator = role.policies.limit(
count=123
)
Creates an iterable of all RolePolicy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
role_policy_iterator = role.policies.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) RolePolicy:
import boto3
iam = boto3.resource('iam')
role_policy = iam.RolePolicy('role_name','name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The RolePolicy's role_name identifier. This must be set.
(string) The RolePolicy's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
(string) --
The name of the policy.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = role_policy.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_role_policy() to update the attributes of the RolePolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
role_policy.load()
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, see 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 the maximum number of inline policies that you can embed with a role, see IAM and STS quotas 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, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = role_policy.put(
PolicyDocument='string'
)
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Calls IAM.Client.get_role_policy() to update the attributes of the RolePolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
role_policy.reload()
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) SamlProvider:
import boto3
iam = boto3.resource('iam')
saml_provider = iam.SamlProvider('arn')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The SamlProvider's arn identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(datetime) --
The date and time when the SAML provider was created.
(string) --
The XML metadata document that includes information about an identity provider.
(list) --
A list of tags that are attached to the specified IAM SAML provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
(datetime) --
The expiration date and time for the SAML provider.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = saml_provider.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_saml_provider() to update the attributes of the SamlProvider resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
saml_provider.load()
Calls IAM.Client.get_saml_provider() to update the attributes of the SamlProvider resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
saml_provider.reload()
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 = saml_provider.update(
SAMLMetadataDocument='string',
)
[REQUIRED]
An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP.
{
'SAMLProviderArn': 'string'
}
Response Structure
Contains the response to a successful UpdateSAMLProvider request.
The Amazon Resource Name (ARN) of the SAML provider that was updated.
A resource representing an AWS Identity and Access Management (IAM) ServerCertificate:
import boto3
iam = boto3.resource('iam')
server_certificate = iam.ServerCertificate('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The ServerCertificate's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The contents of the public key certificate.
(string) --
The contents of the public key certificate chain.
(dict) --
The meta information of the server certificate, such as its name, path, ID, and ARN.
Path (string) --
The path to the server certificate. For more information about paths, see IAM identifiers in the IAM User Guide .
ServerCertificateName (string) --
The name that identifies the server certificate.
ServerCertificateId (string) --
The stable and unique string identifying the server certificate. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) specifying the server certificate. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide .
UploadDate (datetime) --
The date when the server certificate was uploaded.
Expiration (datetime) --
The date on which the certificate is set to expire.
(list) --
A list of tags that are attached to the server certificate. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Deletes the specified server certificate.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic also includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
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, see DeleteLoadBalancerListeners in the Elastic Load Balancing API Reference .
See also: AWS API Documentation
Request Syntax
response = server_certificate.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_server_certificate() to update the attributes of the ServerCertificate resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
server_certificate.load()
Calls IAM.Client.get_server_certificate() to update the attributes of the ServerCertificate resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
server_certificate.reload()
Updates the name and/or the path of the specified server certificate stored in IAM.
For more information about working with server certificates, see Working with server certificates in the IAM User Guide . This topic also includes a list of Amazon Web Services services that can use the server certificates that you manage with IAM.
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
The person making the request (the principal), must have permission to change the server certificate with the old name and the new name. For example, to change the certificate named ProductionCert to ProdCert , the principal must have a policy that allows them to update both certificates. If the principal has permission to update the ProductionCert group, but not the ProdCert certificate, then the update fails. For more information about permissions, see Access management in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
server_certificate = server_certificate.update(
NewPath='string',
NewServerCertificateName='string'
)
The new path for the server certificate. Include this only if you are updating the server certificate's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
The new name for the server certificate. Include this only if you are updating the server certificate's name. The name of the certificate cannot contain any spaces.
This parameter allows (through 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: _+=,.@-
iam.ServerCertificate
ServerCertificate resource
A resource representing an AWS Identity and Access Management (IAM) SigningCertificate:
import boto3
iam = boto3.resource('iam')
signing_certificate = iam.SigningCertificate('user_name','id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The SigningCertificate's user_name identifier. This must be set.
(string) The SigningCertificate's id identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The contents of the signing certificate.
(string) --
The ID for the signing certificate.
(string) --
The status of the signing certificate. Active means that the key is valid for API calls, while Inactive means it is not.
(datetime) --
The date when the signing certificate was uploaded.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Changes the status of the specified user signing certificate from active to disabled, or vice versa. This operation 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 user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = signing_certificate.activate()
Changes the status of the specified user signing certificate from active to disabled, or vice versa. This operation 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 user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated users.
See also: AWS API Documentation
Request Syntax
response = signing_certificate.deactivate()
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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials even if the account has no associated IAM users.
See also: AWS API Documentation
Request Syntax
response = signing_certificate.delete()
Returns a list of all the available sub-resources for this Resource.
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) User:
import boto3
iam = boto3.resource('iam')
user = iam.User('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The User's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
(datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
(datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
(string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
(dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
(list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
(string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
(string) --
The friendly name identifying the user.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
Adds the specified user to the specified group.
See also: AWS API Documentation
Request Syntax
response = user.add_group(
GroupName='string',
)
[REQUIRED]
The name of the group to update.
This parameter allows (through 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: _+=,.@-
Attaches the specified managed policy to the specified user.
You use this operation to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
For more information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = user.attach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
Creates a new IAM user for your account.
For information about quotas for the number of IAM users you can create, see IAM and STS quotas in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
user = user.create(
Path='string',
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The path for the user name. For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
A list of tags that you want to attach to the new user. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
iam.User
User resource
Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services 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 Amazon Web Services access key ID signing the request. This operation works for access keys under the account. Consequently, you can use this operation to manage account root user credentials. This is true even if the account has no associated users.
For information about quotas on the number of keys you can create, see IAM and STS quotas in the IAM User Guide .
Warning
To ensure the security of your 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
access_key_pair = user.create_access_key_pair()
Creates a password for the specified IAM user. A password allows an IAM user to access Amazon Web Services services through the Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to create a password for any IAM user. Use ChangePassword to update your own existing password in the My Security Credentials page in the Management Console.
For more information about managing passwords, see Managing passwords in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
login_profile = user.create_login_profile(
Password='string',
PasswordResetRequired=True|False
)
[REQUIRED]
The new password for the user.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (\u0020 ) through the end of the ASCII character range (\u00FF ). You can also include the tab (\u0009 ), line feed (\u000A ), and carriage return (\u000D ) characters. Any of these characters are valid in a password. However, many tools, such as the Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.
iam.LoginProfile
LoginProfile resource
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 the maximum number of inline policies that you can embed in a user, see IAM and STS quotas 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, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
user_policy = user.create_policy(
PolicyName='string',
PolicyDocument='string'
)
[REQUIRED]
The name of the policy document.
This parameter allows (through 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: _+=,.@-
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
iam.UserPolicy
UserPolicy resource
Deletes the specified IAM user. Unlike the Management Console, when you delete a user programmatically, you must delete the items attached to the user manually, or the deletion fails. For more information, see Deleting an IAM user . Before attempting to delete a user, remove the following items:
See also: AWS API Documentation
Request Syntax
response = user.delete()
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 DeleteUserPolicy . For information about policies, see Managed policies and inline policies in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = user.detach_policy(
PolicyArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
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
mfa_device = user.enable_mfa(
SerialNumber='string',
AuthenticationCode1='string',
AuthenticationCode2='string'
)
[REQUIRED]
The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN.
This parameter allows (through 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: =,.@:/-
[REQUIRED]
An authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
[REQUIRED]
A subsequent authentication code emitted by the device.
The format for this parameter is a string of six digits.
Warning
Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device .
iam.MfaDevice
MfaDevice resource
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_user() to update the attributes of the User resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
user.load()
Calls IAM.Client.get_user() to update the attributes of the User resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
user.reload()
Removes the specified user from the specified group.
See also: AWS API Documentation
Request Syntax
response = user.remove_group(
GroupName='string',
)
[REQUIRED]
The name of the group to update.
This parameter allows (through 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: _+=,.@-
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
user = user.update(
NewPath='string',
NewUserName='string'
)
New path for the IAM user. Include this parameter only if you're changing the user's path.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
New name for the user. Include this parameter only if you're changing the user's name.
IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".
iam.User
User resource
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a AccessKey resource.:
access_key = user.AccessKey('id')
Creates a LoginProfile resource.:
login_profile = user.LoginProfile()
Creates a MfaDevice resource.:
mfa_device = user.MfaDevice('serial_number')
Creates a UserPolicy resource.:
user_policy = user.Policy('name')
Creates a SigningCertificate resource.:
signing_certificate = user.SigningCertificate('id')
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of AccessKey resources.A AccessKey Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all AccessKey resources in the collection.
See also: AWS API Documentation
Request Syntax
access_key_iterator = user.access_keys.all()
Creates an iterable of all AccessKey resources in the collection filtered by kwargs passed to method.A AccessKey collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
access_key_iterator = user.access_keys.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.AccessKey)
A list of AccessKey resources
Creates an iterable up to a specified amount of AccessKey resources in the collection.
See also: AWS API Documentation
Request Syntax
access_key_iterator = user.access_keys.limit(
count=123
)
Creates an iterable of all AccessKey resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
access_key_iterator = user.access_keys.page_size(
count=123
)
A collection of Policy resources.A Policy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = user.attached_policies.all()
Creates an iterable of all Policy resources in the collection filtered by kwargs passed to method.A Policy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
policy_iterator = user.attached_policies.filter(
PathPrefix='string',
Marker='string',
MaxItems=123
)
The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies.
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021 ) through the DEL character (\u007F ), including most punctuation characters, digits, and upper and lowercased letters.
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Policy)
A list of Policy resources
Creates an iterable up to a specified amount of Policy resources in the collection.
See also: AWS API Documentation
Request Syntax
policy_iterator = user.attached_policies.limit(
count=123
)
Creates an iterable of all Policy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
policy_iterator = user.attached_policies.page_size(
count=123
)
A collection of Group resources.A Group Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = user.groups.all()
Creates an iterable of all Group resources in the collection filtered by kwargs passed to method.A Group collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
group_iterator = user.groups.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.Group)
A list of Group resources
Creates an iterable up to a specified amount of Group resources in the collection.
See also: AWS API Documentation
Request Syntax
group_iterator = user.groups.limit(
count=123
)
Creates an iterable of all Group resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
group_iterator = user.groups.page_size(
count=123
)
A collection of MfaDevice resources.A MfaDevice Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all MfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = user.mfa_devices.all()
Creates an iterable of all MfaDevice resources in the collection filtered by kwargs passed to method.A MfaDevice collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = user.mfa_devices.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.MfaDevice)
A list of MfaDevice resources
Creates an iterable up to a specified amount of MfaDevice resources in the collection.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = user.mfa_devices.limit(
count=123
)
Creates an iterable of all MfaDevice resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
mfa_device_iterator = user.mfa_devices.page_size(
count=123
)
A collection of UserPolicy resources.A UserPolicy Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all UserPolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
user_policy_iterator = user.policies.all()
Creates an iterable of all UserPolicy resources in the collection filtered by kwargs passed to method.A UserPolicy collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
user_policy_iterator = user.policies.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.UserPolicy)
A list of UserPolicy resources
Creates an iterable up to a specified amount of UserPolicy resources in the collection.
See also: AWS API Documentation
Request Syntax
user_policy_iterator = user.policies.limit(
count=123
)
Creates an iterable of all UserPolicy resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
user_policy_iterator = user.policies.page_size(
count=123
)
A collection of SigningCertificate resources.A SigningCertificate Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
Creates an iterable of all SigningCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = user.signing_certificates.all()
Creates an iterable of all SigningCertificate resources in the collection filtered by kwargs passed to method.A SigningCertificate collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = user.signing_certificates.filter(
Marker='string',
MaxItems=123
)
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true .
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true , and Marker contains a value to include in the subsequent call that tells the service where to continue from.
list(iam.SigningCertificate)
A list of SigningCertificate resources
Creates an iterable up to a specified amount of SigningCertificate resources in the collection.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = user.signing_certificates.limit(
count=123
)
Creates an iterable of all SigningCertificate resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
signing_certificate_iterator = user.signing_certificates.page_size(
count=123
)
A resource representing an AWS Identity and Access Management (IAM) UserPolicy:
import boto3
iam = boto3.resource('iam')
user_policy = iam.UserPolicy('user_name','name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The UserPolicy's user_name identifier. This must be set.
(string) The UserPolicy's name identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(string) --
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
(string) --
The name of the policy.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = user_policy.delete()
Returns a list of all the available sub-resources for this Resource.
Calls IAM.Client.get_user_policy() to update the attributes of the UserPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
user_policy.load()
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 the maximum number of inline policies that you can embed in a user, see IAM and STS quotas 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, see Making query requests in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = user_policy.put(
PolicyDocument='string'
)
[REQUIRED]
The policy document.
You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
The regex pattern used to validate this parameter is a string of characters consisting of the following:
Calls IAM.Client.get_user_policy() to update the attributes of the UserPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
user_policy.reload()
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
A resource representing an AWS Identity and Access Management (IAM) VirtualMfaDevice:
import boto3
iam = boto3.resource('iam')
virtual_mfa_device = iam.VirtualMfaDevice('serial_number')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The VirtualMfaDevice's serial_number identifier. This must be set.
Attributes
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load() method. For more information about attributes refer to the Resources Introduction Guide.
(bytes) --
The base32 seed defined as specified in RFC3548 . The Base32StringSeed is base64-encoded.
(datetime) --
The date and time on which the virtual MFA device was enabled.
(bytes) --
A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String where $virtualMFADeviceName is one of the create call arguments. AccountName is the user name if set (otherwise, the account ID otherwise), and Base32String is the seed in base32 format. The Base32String value is base64-encoded.
(list) --
A list of tags that are attached to the virtual MFA device. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
(dict) --
The IAM user associated with this virtual MFA device.
Path (string) --
The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide .
The ARN of the policy used to set the permissions boundary for the user.
UserName (string) --
The friendly name identifying the user.
UserId (string) --
The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide .
Arn (string) --
The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide .
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format , when the user was created.
PasswordLastUsed (datetime) --
The date and time, in ISO 8601 date-time format , when the user's password was last used to sign in to an Amazon Web Services website. For a list of Amazon Web Services websites that capture a user's last sign-in time, see the Credential reports topic in the IAM User Guide . If a password is used more than once in a five-minute span, only the first use is returned in this field. If the field is null (no value), then it indicates that they never signed in with a password. This can be because:
A null value does not mean that the user never had a password. Also, if the user does not currently have a password but had one in the past, then this field contains the date and time the most recent password was used.
This value is returned only in the GetUser and ListUsers operations.
PermissionsBoundary (dict) --
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
PermissionsBoundaryType (string) --
The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy .
PermissionsBoundaryArn (string) --
The ARN of the policy used to set the permissions boundary for the user or role.
Tags (list) --
A list of tags that are associated with the user. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
(dict) --
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key (string) --
The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.
Value (string) --
The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources , Accounting , and Support . Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.
Note
Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(User) The related user if set, otherwise None.
Actions
Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide.
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 = virtual_mfa_device.delete()
Returns a list of all the available sub-resources for this Resource.