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
12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 | |