Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class GetAccountPasswordPolicyCommandProtected

Retrieves the password policy for the Amazon Web Services account. This tells you the complexity requirements and mandatory rotation periods for the IAM user passwords in your account. For more information about using a password policy, see Managing an IAM password policy.

Example

Use a bare-bones client and the command you need to make an API call.

import { IAMClient, GetAccountPasswordPolicyCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, GetAccountPasswordPolicyCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = {};
const command = new GetAccountPasswordPolicyCommand(input);
const response = await client.send(command);
// { // GetAccountPasswordPolicyResponse
// PasswordPolicy: { // PasswordPolicy
// MinimumPasswordLength: Number("int"),
// RequireSymbols: true || false,
// RequireNumbers: true || false,
// RequireUppercaseCharacters: true || false,
// RequireLowercaseCharacters: true || false,
// AllowUsersToChangePassword: true || false,
// ExpirePasswords: true || false,
// MaxPasswordAge: Number("int"),
// PasswordReusePrevention: Number("int"),
// HardExpiry: true || false,
// },
// };

Param

GetAccountPasswordPolicyCommandInput

Returns

GetAccountPasswordPolicyCommandOutput

See

Throws

NoSuchEntityException (client fault)

The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

Throws

ServiceFailureException (server fault)

The request processing has failed because of an unknown error, exception or failure.

Throws

IAMServiceException

Base exception class for all service exceptions from IAM service.

Example

To see the current account password policy

// The following command displays details about the password policy for the current AWS account.
const input = undefined;
const command = new GetAccountPasswordPolicyCommand(input);
const response = await client.send(command);
/* response ==
{
"PasswordPolicy": {
"AllowUsersToChangePassword": false,
"ExpirePasswords": false,
"HardExpiry": false,
"MaxPasswordAge": 90,
"MinimumPasswordLength": 8,
"PasswordReusePrevention": 12,
"RequireLowercaseCharacters": false,
"RequireNumbers": true,
"RequireSymbols": true,
"RequireUppercaseCharacters": false
}
}
*/
// example id: 5e4598c7-c425-431f-8af1-19073b3c4a5f

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods