update_account_password_policy
¶
update_account_password_policy(
*,
config_overrides: Optional[IAMClientConfig] = 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/iam.py
10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 | |