updateAccountPasswordPolicy method
Updates the password policy settings for the Amazon Web Services account. For more information about using a password policy, see Managing an IAM password policy in the IAM User Guide.
May throw LimitExceededException.
May throw MalformedPolicyDocumentException.
May throw NoSuchEntityException.
May throw ServiceFailureException.
Parameter allowUsersToChangePassword :
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.
Parameter hardExpiry :
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.
Parameter maxPasswordAge :
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.
Parameter minimumPasswordLength :
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.
Parameter passwordReusePrevention :
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.
Parameter requireLowercaseCharacters :
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.
Parameter requireNumbers :
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.
Parameter requireSymbols :
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.
Parameter requireUppercaseCharacters :
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.
Implementation
Future<void> updateAccountPasswordPolicy({
bool? allowUsersToChangePassword,
bool? hardExpiry,
int? maxPasswordAge,
int? minimumPasswordLength,
int? passwordReusePrevention,
bool? requireLowercaseCharacters,
bool? requireNumbers,
bool? requireSymbols,
bool? requireUppercaseCharacters,
}) async {
_s.validateNumRange(
'maxPasswordAge',
maxPasswordAge,
1,
1095,
);
_s.validateNumRange(
'minimumPasswordLength',
minimumPasswordLength,
6,
128,
);
_s.validateNumRange(
'passwordReusePrevention',
passwordReusePrevention,
1,
24,
);
final $request = <String, String>{
if (allowUsersToChangePassword != null)
'AllowUsersToChangePassword': allowUsersToChangePassword.toString(),
if (hardExpiry != null) 'HardExpiry': hardExpiry.toString(),
if (maxPasswordAge != null) 'MaxPasswordAge': maxPasswordAge.toString(),
if (minimumPasswordLength != null)
'MinimumPasswordLength': minimumPasswordLength.toString(),
if (passwordReusePrevention != null)
'PasswordReusePrevention': passwordReusePrevention.toString(),
if (requireLowercaseCharacters != null)
'RequireLowercaseCharacters': requireLowercaseCharacters.toString(),
if (requireNumbers != null) 'RequireNumbers': requireNumbers.toString(),
if (requireSymbols != null) 'RequireSymbols': requireSymbols.toString(),
if (requireUppercaseCharacters != null)
'RequireUppercaseCharacters': requireUppercaseCharacters.toString(),
};
await _protocol.send(
$request,
action: 'UpdateAccountPasswordPolicy',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
);
}