1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ram
  5. PasswordPolicy
Viewing docs for Alibaba Cloud v3.97.0
published on Saturday, Mar 14, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.97.0
published on Saturday, Mar 14, 2026 by Pulumi

    Provides a RAM Password Policy resource.

    Password strength information.

    For information about RAM Password Policy and how to use it, see What is Password Policy.

    NOTE: Available since v1.247.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.ram.PasswordPolicy("default", {
        minimumPasswordLength: 8,
        requireLowercaseCharacters: false,
        requireNumbers: false,
        maxPasswordAge: 0,
        passwordReusePrevention: 1,
        maxLoginAttemps: 1,
        hardExpiry: false,
        requireUppercaseCharacters: false,
        requireSymbols: false,
        passwordNotContainUserName: false,
        minimumPasswordDifferentCharacter: 1,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.ram.PasswordPolicy("default",
        minimum_password_length=8,
        require_lowercase_characters=False,
        require_numbers=False,
        max_password_age=0,
        password_reuse_prevention=1,
        max_login_attemps=1,
        hard_expiry=False,
        require_uppercase_characters=False,
        require_symbols=False,
        password_not_contain_user_name=False,
        minimum_password_different_character=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := ram.NewPasswordPolicy(ctx, "default", &ram.PasswordPolicyArgs{
    			MinimumPasswordLength:             pulumi.Int(8),
    			RequireLowercaseCharacters:        pulumi.Bool(false),
    			RequireNumbers:                    pulumi.Bool(false),
    			MaxPasswordAge:                    pulumi.Int(0),
    			PasswordReusePrevention:           pulumi.Int(1),
    			MaxLoginAttemps:                   pulumi.Int(1),
    			HardExpiry:                        pulumi.Bool(false),
    			RequireUppercaseCharacters:        pulumi.Bool(false),
    			RequireSymbols:                    pulumi.Bool(false),
    			PasswordNotContainUserName:        pulumi.Bool(false),
    			MinimumPasswordDifferentCharacter: pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.Ram.PasswordPolicy("default", new()
        {
            MinimumPasswordLength = 8,
            RequireLowercaseCharacters = false,
            RequireNumbers = false,
            MaxPasswordAge = 0,
            PasswordReusePrevention = 1,
            MaxLoginAttemps = 1,
            HardExpiry = false,
            RequireUppercaseCharacters = false,
            RequireSymbols = false,
            PasswordNotContainUserName = false,
            MinimumPasswordDifferentCharacter = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ram.PasswordPolicy;
    import com.pulumi.alicloud.ram.PasswordPolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new PasswordPolicy("default", PasswordPolicyArgs.builder()
                .minimumPasswordLength(8)
                .requireLowercaseCharacters(false)
                .requireNumbers(false)
                .maxPasswordAge(0)
                .passwordReusePrevention(1)
                .maxLoginAttemps(1)
                .hardExpiry(false)
                .requireUppercaseCharacters(false)
                .requireSymbols(false)
                .passwordNotContainUserName(false)
                .minimumPasswordDifferentCharacter(1)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:ram:PasswordPolicy
        properties:
          minimumPasswordLength: '8'
          requireLowercaseCharacters: false
          requireNumbers: false
          maxPasswordAge: '0'
          passwordReusePrevention: '1'
          maxLoginAttemps: '1'
          hardExpiry: false
          requireUppercaseCharacters: false
          requireSymbols: false
          passwordNotContainUserName: false
          minimumPasswordDifferentCharacter: '1'
    

    Deleting alicloud.ram.PasswordPolicy or removing it from your configuration

    Terraform cannot destroy resource alicloud.ram.PasswordPolicy. Terraform will remove this resource from the state file, however resources may remain.

    📚 Need more examples? VIEW MORE EXAMPLES

    Create PasswordPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PasswordPolicy(name: string, args?: PasswordPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def PasswordPolicy(resource_name: str,
                       args: Optional[PasswordPolicyArgs] = None,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def PasswordPolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       hard_expiry: Optional[bool] = None,
                       max_login_attemps: Optional[int] = None,
                       max_password_age: Optional[int] = None,
                       minimum_password_different_character: Optional[int] = None,
                       minimum_password_length: Optional[int] = None,
                       password_not_contain_user_name: Optional[bool] = None,
                       password_reuse_prevention: Optional[int] = None,
                       require_lowercase_characters: Optional[bool] = None,
                       require_numbers: Optional[bool] = None,
                       require_symbols: Optional[bool] = None,
                       require_uppercase_characters: Optional[bool] = None)
    func NewPasswordPolicy(ctx *Context, name string, args *PasswordPolicyArgs, opts ...ResourceOption) (*PasswordPolicy, error)
    public PasswordPolicy(string name, PasswordPolicyArgs? args = null, CustomResourceOptions? opts = null)
    public PasswordPolicy(String name, PasswordPolicyArgs args)
    public PasswordPolicy(String name, PasswordPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:ram:PasswordPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PasswordPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PasswordPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PasswordPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PasswordPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PasswordPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var passwordPolicyResource = new AliCloud.Ram.PasswordPolicy("passwordPolicyResource", new()
    {
        HardExpiry = false,
        MaxLoginAttemps = 0,
        MaxPasswordAge = 0,
        MinimumPasswordDifferentCharacter = 0,
        MinimumPasswordLength = 0,
        PasswordNotContainUserName = false,
        PasswordReusePrevention = 0,
        RequireLowercaseCharacters = false,
        RequireNumbers = false,
        RequireSymbols = false,
        RequireUppercaseCharacters = false,
    });
    
    example, err := ram.NewPasswordPolicy(ctx, "passwordPolicyResource", &ram.PasswordPolicyArgs{
    	HardExpiry:                        pulumi.Bool(false),
    	MaxLoginAttemps:                   pulumi.Int(0),
    	MaxPasswordAge:                    pulumi.Int(0),
    	MinimumPasswordDifferentCharacter: pulumi.Int(0),
    	MinimumPasswordLength:             pulumi.Int(0),
    	PasswordNotContainUserName:        pulumi.Bool(false),
    	PasswordReusePrevention:           pulumi.Int(0),
    	RequireLowercaseCharacters:        pulumi.Bool(false),
    	RequireNumbers:                    pulumi.Bool(false),
    	RequireSymbols:                    pulumi.Bool(false),
    	RequireUppercaseCharacters:        pulumi.Bool(false),
    })
    
    var passwordPolicyResource = new PasswordPolicy("passwordPolicyResource", PasswordPolicyArgs.builder()
        .hardExpiry(false)
        .maxLoginAttemps(0)
        .maxPasswordAge(0)
        .minimumPasswordDifferentCharacter(0)
        .minimumPasswordLength(0)
        .passwordNotContainUserName(false)
        .passwordReusePrevention(0)
        .requireLowercaseCharacters(false)
        .requireNumbers(false)
        .requireSymbols(false)
        .requireUppercaseCharacters(false)
        .build());
    
    password_policy_resource = alicloud.ram.PasswordPolicy("passwordPolicyResource",
        hard_expiry=False,
        max_login_attemps=0,
        max_password_age=0,
        minimum_password_different_character=0,
        minimum_password_length=0,
        password_not_contain_user_name=False,
        password_reuse_prevention=0,
        require_lowercase_characters=False,
        require_numbers=False,
        require_symbols=False,
        require_uppercase_characters=False)
    
    const passwordPolicyResource = new alicloud.ram.PasswordPolicy("passwordPolicyResource", {
        hardExpiry: false,
        maxLoginAttemps: 0,
        maxPasswordAge: 0,
        minimumPasswordDifferentCharacter: 0,
        minimumPasswordLength: 0,
        passwordNotContainUserName: false,
        passwordReusePrevention: 0,
        requireLowercaseCharacters: false,
        requireNumbers: false,
        requireSymbols: false,
        requireUppercaseCharacters: false,
    });
    
    type: alicloud:ram:PasswordPolicy
    properties:
        hardExpiry: false
        maxLoginAttemps: 0
        maxPasswordAge: 0
        minimumPasswordDifferentCharacter: 0
        minimumPasswordLength: 0
        passwordNotContainUserName: false
        passwordReusePrevention: 0
        requireLowercaseCharacters: false
        requireNumbers: false
        requireSymbols: false
        requireUppercaseCharacters: false
    

    PasswordPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PasswordPolicy resource accepts the following input properties:

    HardExpiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    MaxLoginAttemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    MaxPasswordAge int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    MinimumPasswordDifferentCharacter int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    MinimumPasswordLength int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    PasswordNotContainUserName bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    PasswordReusePrevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    RequireLowercaseCharacters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    RequireNumbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    RequireSymbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    RequireUppercaseCharacters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    HardExpiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    MaxLoginAttemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    MaxPasswordAge int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    MinimumPasswordDifferentCharacter int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    MinimumPasswordLength int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    PasswordNotContainUserName bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    PasswordReusePrevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    RequireLowercaseCharacters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    RequireNumbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    RequireSymbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    RequireUppercaseCharacters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry Boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps Integer
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge Integer
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter Integer
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength Integer
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName Boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention Integer
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters Boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers Boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols Boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters Boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps number
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge number
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter number
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength number
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention number
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hard_expiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    max_login_attemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    max_password_age int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimum_password_different_character int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimum_password_length int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    password_not_contain_user_name bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    password_reuse_prevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    require_lowercase_characters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    require_numbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    require_symbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    require_uppercase_characters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry Boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps Number
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge Number
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter Number
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength Number
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName Boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention Number
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters Boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers Boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols Boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters Boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PasswordPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PasswordPolicy Resource

    Get an existing PasswordPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PasswordPolicyState, opts?: CustomResourceOptions): PasswordPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            hard_expiry: Optional[bool] = None,
            max_login_attemps: Optional[int] = None,
            max_password_age: Optional[int] = None,
            minimum_password_different_character: Optional[int] = None,
            minimum_password_length: Optional[int] = None,
            password_not_contain_user_name: Optional[bool] = None,
            password_reuse_prevention: Optional[int] = None,
            require_lowercase_characters: Optional[bool] = None,
            require_numbers: Optional[bool] = None,
            require_symbols: Optional[bool] = None,
            require_uppercase_characters: Optional[bool] = None) -> PasswordPolicy
    func GetPasswordPolicy(ctx *Context, name string, id IDInput, state *PasswordPolicyState, opts ...ResourceOption) (*PasswordPolicy, error)
    public static PasswordPolicy Get(string name, Input<string> id, PasswordPolicyState? state, CustomResourceOptions? opts = null)
    public static PasswordPolicy get(String name, Output<String> id, PasswordPolicyState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:ram:PasswordPolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    HardExpiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    MaxLoginAttemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    MaxPasswordAge int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    MinimumPasswordDifferentCharacter int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    MinimumPasswordLength int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    PasswordNotContainUserName bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    PasswordReusePrevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    RequireLowercaseCharacters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    RequireNumbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    RequireSymbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    RequireUppercaseCharacters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    HardExpiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    MaxLoginAttemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    MaxPasswordAge int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    MinimumPasswordDifferentCharacter int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    MinimumPasswordLength int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    PasswordNotContainUserName bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    PasswordReusePrevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    RequireLowercaseCharacters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    RequireNumbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    RequireSymbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    RequireUppercaseCharacters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry Boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps Integer
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge Integer
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter Integer
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength Integer
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName Boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention Integer
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters Boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers Boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols Boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters Boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps number
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge number
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter number
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength number
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention number
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hard_expiry bool
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    max_login_attemps int
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    max_password_age int
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimum_password_different_character int
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimum_password_length int
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    password_not_contain_user_name bool
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    password_reuse_prevention int
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    require_lowercase_characters bool
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    require_numbers bool
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    require_symbols bool
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    require_uppercase_characters bool
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)
    hardExpiry Boolean
    Whether to restrict logon after the password expires. Value:

    • true: After the password expires, you cannot log in to the console. You must reset the password of the RAM user through the main account or a RAM user with administrator permissions to log on normally.
    • false (default): After the password expires, the RAM user can change the password and log on normally.
    maxLoginAttemps Number
    Password retry constraint. After entering the wrong password continuously for the set number of times, the account will be locked for one hour. Value range: 0~32. Default value: 0, which means that the password retry constraint is not enabled.
    maxPasswordAge Number
    Password validity period. Value range: 0~1095. Unit: days. Default value: 0, which means never expires.
    minimumPasswordDifferentCharacter Number
    The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password.
    minimumPasswordLength Number
    The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8.
    passwordNotContainUserName Boolean
    Whether the user name is not allowed in the password. Value:

    • true: The password cannot contain the user name.
    • false (default): The user name can be included in the password.
    passwordReusePrevention Number
    Historical password check policy. Do not use the previous N Passwords. The value range of N is 0 to 24. Default value: 0, indicating that the historical password check policy is not enabled.
    requireLowercaseCharacters Boolean
    Specifies whether the password must contain lowercase letters. Valid values:

    • true
    • false (default)
    requireNumbers Boolean
    Specifies whether the password must contain digits. Valid values:

    • true
    • false (default)
    requireSymbols Boolean
    Specifies whether the password must contain special characters. Valid values:

    • true
    • false (default)
    requireUppercaseCharacters Boolean
    Specifies whether the password must contain uppercase letters. Valid values:

    • true
    • false (default)

    Import

    RAM Password Policy can be imported using the id, e.g.

    $ pulumi import alicloud:ram/passwordPolicy:PasswordPolicy example <id>.
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Viewing docs for Alibaba Cloud v3.97.0
    published on Saturday, Mar 14, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.