# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class AccountPasswordPolicy(pulumi.CustomResource):
    hard_expiry: pulumi.Output[bool]
    """
    Specifies if a password can expire in a hard way. Default to false.
    """
    max_login_attempts: pulumi.Output[float]
    """
    Maximum logon attempts with an incorrect password within an hour. Valid value range: [0-32]. Default to 5.
    """
    max_password_age: pulumi.Output[float]
    """
    The number of days after which password expires. A value of 0 indicates that the password never expires. Valid value range: [0-1095]. Default to 0.
    """
    minimum_password_length: pulumi.Output[float]
    """
    Minimal required length of password for a user. Valid value range: [8-32]. Default to 12.
    """
    password_reuse_prevention: pulumi.Output[float]
    """
    User is not allowed to use the latest number of passwords specified in this parameter. A value of 0 indicates the password history check policy is disabled. Valid value range: [0-24]. Default to 0.
    """
    require_lowercase_characters: pulumi.Output[bool]
    """
    Specifies if the occurrence of a lowercase character in the password is mandatory. Default to true.
    """
    require_numbers: pulumi.Output[bool]
    """
    Specifies if the occurrence of a number in the password is mandatory. Default to true.
    """
    require_symbols: pulumi.Output[bool]
    """
    (Optional Specifies if the occurrence of a special character in the password is mandatory. Default to true.
    """
    require_uppercase_characters: pulumi.Output[bool]
    """
    Specifies if the occurrence of an uppercase character in the password is mandatory. Default to true.
    """
    def __init__(__self__, resource_name, opts=None, hard_expiry=None, max_login_attempts=None, max_password_age=None, minimum_password_length=None, password_reuse_prevention=None, require_lowercase_characters=None, require_numbers=None, require_symbols=None, require_uppercase_characters=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a AccountPasswordPolicy resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[bool] hard_expiry: Specifies if a password can expire in a hard way. Default to false.
        :param pulumi.Input[float] max_login_attempts: Maximum logon attempts with an incorrect password within an hour. Valid value range: [0-32]. Default to 5.
        :param pulumi.Input[float] max_password_age: The number of days after which password expires. A value of 0 indicates that the password never expires. Valid value range: [0-1095]. Default to 0.
        :param pulumi.Input[float] minimum_password_length: Minimal required length of password for a user. Valid value range: [8-32]. Default to 12.
        :param pulumi.Input[float] password_reuse_prevention: User is not allowed to use the latest number of passwords specified in this parameter. A value of 0 indicates the password history check policy is disabled. Valid value range: [0-24]. Default to 0.
        :param pulumi.Input[bool] require_lowercase_characters: Specifies if the occurrence of a lowercase character in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_numbers: Specifies if the occurrence of a number in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_symbols: (Optional Specifies if the occurrence of a special character in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_uppercase_characters: Specifies if the occurrence of an uppercase character in the password is mandatory. Default to true.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['hard_expiry'] = hard_expiry
            __props__['max_login_attempts'] = max_login_attempts
            __props__['max_password_age'] = max_password_age
            __props__['minimum_password_length'] = minimum_password_length
            __props__['password_reuse_prevention'] = password_reuse_prevention
            __props__['require_lowercase_characters'] = require_lowercase_characters
            __props__['require_numbers'] = require_numbers
            __props__['require_symbols'] = require_symbols
            __props__['require_uppercase_characters'] = require_uppercase_characters
        super(AccountPasswordPolicy, __self__).__init__(
            'alicloud:ram/accountPasswordPolicy:AccountPasswordPolicy',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, hard_expiry=None, max_login_attempts=None, max_password_age=None, minimum_password_length=None, password_reuse_prevention=None, require_lowercase_characters=None, require_numbers=None, require_symbols=None, require_uppercase_characters=None):
        """
        Get an existing AccountPasswordPolicy resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[bool] hard_expiry: Specifies if a password can expire in a hard way. Default to false.
        :param pulumi.Input[float] max_login_attempts: Maximum logon attempts with an incorrect password within an hour. Valid value range: [0-32]. Default to 5.
        :param pulumi.Input[float] max_password_age: The number of days after which password expires. A value of 0 indicates that the password never expires. Valid value range: [0-1095]. Default to 0.
        :param pulumi.Input[float] minimum_password_length: Minimal required length of password for a user. Valid value range: [8-32]. Default to 12.
        :param pulumi.Input[float] password_reuse_prevention: User is not allowed to use the latest number of passwords specified in this parameter. A value of 0 indicates the password history check policy is disabled. Valid value range: [0-24]. Default to 0.
        :param pulumi.Input[bool] require_lowercase_characters: Specifies if the occurrence of a lowercase character in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_numbers: Specifies if the occurrence of a number in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_symbols: (Optional Specifies if the occurrence of a special character in the password is mandatory. Default to true.
        :param pulumi.Input[bool] require_uppercase_characters: Specifies if the occurrence of an uppercase character in the password is mandatory. Default to true.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["hard_expiry"] = hard_expiry
        __props__["max_login_attempts"] = max_login_attempts
        __props__["max_password_age"] = max_password_age
        __props__["minimum_password_length"] = minimum_password_length
        __props__["password_reuse_prevention"] = password_reuse_prevention
        __props__["require_lowercase_characters"] = require_lowercase_characters
        __props__["require_numbers"] = require_numbers
        __props__["require_symbols"] = require_symbols
        __props__["require_uppercase_characters"] = require_uppercase_characters
        return AccountPasswordPolicy(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

