iam.password-policy.update

Set the password policy (the whole policy)

PUT /iam/api/password-policyIAM iam:UpdatePasswordPolicyChanges stateDestructive

Applies to IAM-user console passwords only. `consolePasswordsAllowed: false` turns IAM-user password sign-in off; an enforced SSO connection does too.

Request syntax

PUT /iam/api/password-policy
{
  "minLength": "number",
  "requireUppercase": "boolean",
  "requireLowercase": "boolean",
  "requireNumbers": "boolean",
  "requireSymbols": "boolean",
  "maxAgeDays": "number",
  "lockoutThreshold": "number",
  "lockoutMinutes": "number",
  "maxSessionHours": "number",
  "consolePasswordsAllowed": "boolean"
}

Request body

  • minLengthRequired

    number

    The fewest characters a password may have (12 by default)

    Constraints: integer, 8-128

  • requireUppercaseRequired

    boolean

    A password needs an uppercase letter A–Z (true by default)

  • requireLowercaseRequired

    boolean

    A password needs a lowercase letter a–z (true by default)

  • requireNumbersRequired

    boolean

    A password needs a digit 0–9 (true by default)

  • requireSymbolsRequired

    boolean

    A password needs a character that is not a letter or digit (false by default)

  • maxAgeDaysRequired

    number

    Days after which a password must be changed; null: never (null by default)

    Constraints: integer, 1-365

    May be null.

  • lockoutThresholdRequired

    number

    Wrong passwords in a row from one address before sign-in from it is locked (5 by default)

    Constraints: integer, 3-20

  • lockoutMinutesRequired

    number

    Minutes a lockout lasts (15 by default)

    Constraints: integer, 1-1440

  • maxSessionHoursRequired

    number

    Hours a console session of an IAM user lasts before signing in again (12 by default)

    Constraints: integer, 1-168

  • consolePasswordsAllowedRequired

    boolean

    false turns console password sign-in off for every IAM user of the organization (true by default)

Response

200 with the policy as stored.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow iam:UpdatePasswordPolicy on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud iam password-policy update --min-length 1 --require-uppercase --require-lowercase --require-numbers --require-symbols --max-age-days 1 --lockout-threshold 1 --lockout-minutes 1 --max-session-hours 1 --console-passwords-allowed

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_iam_password-policy_update.