update_account_password_policy
async
¶
update_account_password_policy(
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
minimum_password_length: Optional[minimumPasswordLengthType] = None,
require_symbols: Optional[booleanType] = None,
require_numbers: Optional[booleanType] = None,
require_uppercase_characters: Optional[booleanType] = None,
require_lowercase_characters: Optional[booleanType] = None,
allow_users_to_change_password: Optional[booleanType] = None,
max_password_age: Optional[maxPasswordAgeType] = None,
password_reuse_prevention: Optional[passwordReusePreventionType] = None,
hard_expiry: Optional[booleanObjectType] = None,
) -> None
Updates the password policy settings for the Amazon Web Services account.
This operation does not support partial updates. No parameters are required, but if you do not specify a parameter, that parameter's value reverts to its default value. See the Request Parameters section for each parameter's default value. Also note that some parameters do not allow the default parameter to be explicitly set. Instead, to invoke the default value, do not include that parameter when you invoke the operation.
For more information about using a password policy, see Managing an IAM password policy in the IAM User Guide.
Parameters:
-
minimum_password_length(Optional[minimumPasswordLengthType], default:None) –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. -
require_symbols(Optional[booleanType], default:None) –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. -
require_numbers(Optional[booleanType], default:None) –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. -
require_uppercase_characters(Optional[booleanType], default:None) –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. -
require_lowercase_characters(Optional[booleanType], default:None) –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. -
allow_users_to_change_password(Optional[booleanType], default:None) –Allows all IAM users in your account to use the Amazon Web Services Management Console to change their own passwords. For more information, see Permitting IAM users to 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. -
max_password_age(Optional[maxPasswordAgeType], default:None) –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. -
password_reuse_prevention(Optional[passwordReusePreventionType], default:None) –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. -
hard_expiry(Optional[booleanObjectType], default:None) –Prevents IAM users who are accessing the account via the Amazon Web Services Management Console from setting a new console password after their password has expired. The IAM user cannot access the console 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.In the Amazon Web Services Management Console, the custom password policy option Allow users to change their own password gives IAM users permissions to
iam:ChangePasswordfor only their user and to theiam:GetAccountPasswordPolicyaction. This option does not attach a permissions policy to each user, rather the permissions are applied at the account-level for all users by IAM. IAM users withiam:ChangePasswordpermission and active access keys can reset their own expired console password using the CLI or API.
Raises:
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
-
MalformedPolicyDocumentException–The request was rejected because the policy document was malformed. The error message describes the specific error.
-
NoSuchEntityException–The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
ServiceFailureException–The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To set or change the current account password policy 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:
Source code in docs_src/capo_iam/_services/async_iam.py
10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 | |