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
12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 | |