Jump to Content

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);

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.

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