Skip to content

IAM  >  Operations  >  change_password

change_password

Operation

change_password async

change_password(input: ChangePasswordInput, plugins: list[Plugin] | None = None) -> ChangePasswordOutput

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 Amazon Web Services Management Console. The Amazon Web Services 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.

Parameters:

Name Type Description Default
input ChangePasswordInput

An instance of ChangePasswordInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ChangePasswordOutput

An instance of ChangePasswordOutput.

Input

ChangePasswordInput dataclass

Bases: _SerdeShape

Dataclass for ChangePasswordInput structure.

Attributes

new_password class-attribute instance-attribute
new_password: str | None = ...
The new password. The new password must conform to the Amazon Web
Services account's password policy, if one exists.

The [regex pattern](http://wikipedia.org/wiki/regex) that is used to
validate this parameter is a string of characters. That string can
include almost any printable ASCII character from the space (` `)
through the end of the ASCII character range (`ΓΏ`). You can also
include the tab (`  `), line feed (`

), and carriage return ( `) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.

old_password class-attribute instance-attribute
old_password: str | None = ...

The IAM user's current password.

Output

ChangePasswordOutput dataclass

Bases: _SerdeShape

Dataclass for ChangePasswordOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.