GetAccountPasswordPolicyCommand

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 Syntax

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,
//   },
// };

Example Usage

 There was an error loading the code editor. Retry

GetAccountPasswordPolicyCommand Input

See GetAccountPasswordPolicyCommandInput for more details
GetAccountPasswordPolicyCommandInput 

GetAccountPasswordPolicyCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
PasswordPolicy
Required
PasswordPolicy | undefined

A structure that contains details about the account's password policy.

Throws

Name
Fault
Details
NoSuchEntityException
client

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

ServiceFailureException
server

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

IAMServiceException
Base exception class for all service exceptions from IAM service.