# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables

__all__ = ['PasswordPolicy']


class PasswordPolicy(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 auth_provider: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 email_recovery: Optional[pulumi.Input[str]] = None,
                 groups_includeds: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 password_auto_unlock_minutes: Optional[pulumi.Input[float]] = None,
                 password_dictionary_lookup: Optional[pulumi.Input[bool]] = None,
                 password_exclude_first_name: Optional[pulumi.Input[bool]] = None,
                 password_exclude_last_name: Optional[pulumi.Input[bool]] = None,
                 password_exclude_username: Optional[pulumi.Input[bool]] = None,
                 password_expire_warn_days: Optional[pulumi.Input[float]] = None,
                 password_history_count: Optional[pulumi.Input[float]] = None,
                 password_max_age_days: Optional[pulumi.Input[float]] = None,
                 password_max_lockout_attempts: Optional[pulumi.Input[float]] = None,
                 password_min_age_minutes: Optional[pulumi.Input[float]] = None,
                 password_min_length: Optional[pulumi.Input[float]] = None,
                 password_min_lowercase: Optional[pulumi.Input[float]] = None,
                 password_min_number: Optional[pulumi.Input[float]] = None,
                 password_min_symbol: Optional[pulumi.Input[float]] = None,
                 password_min_uppercase: Optional[pulumi.Input[float]] = None,
                 password_show_lockout_failures: Optional[pulumi.Input[bool]] = None,
                 priority: Optional[pulumi.Input[float]] = None,
                 question_min_length: Optional[pulumi.Input[float]] = None,
                 question_recovery: Optional[pulumi.Input[str]] = None,
                 recovery_email_token: Optional[pulumi.Input[float]] = None,
                 skip_unlock: Optional[pulumi.Input[bool]] = None,
                 sms_recovery: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Create a PasswordPolicy 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[str] auth_provider: Authentication Provider: OKTA or ACTIVE_DIRECTORY.
        :param pulumi.Input[str] description: Policy Description
        :param pulumi.Input[str] email_recovery: Enable or disable email password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[List[pulumi.Input[str]]] groups_includeds: List of Group IDs to Include
        :param pulumi.Input[str] name: Policy Name
        :param pulumi.Input[float] password_auto_unlock_minutes: Number of minutes before a locked account is unlocked: 0 = no limit.
        :param pulumi.Input[bool] password_dictionary_lookup: Check Passwords Against Common Password Dictionary.
        :param pulumi.Input[bool] password_exclude_first_name: User firstName attribute must be excluded from the password
        :param pulumi.Input[bool] password_exclude_last_name: User lastName attribute must be excluded from the password
        :param pulumi.Input[bool] password_exclude_username: If the user name must be excluded from the password.
        :param pulumi.Input[float] password_expire_warn_days: Length in days a user will be warned before password expiry: 0 = no warning.
        :param pulumi.Input[float] password_history_count: Number of distinct passwords that must be created before they can be reused: 0 = none.
        :param pulumi.Input[float] password_max_age_days: Length in days a password is valid before expiry: 0 = no limit.
        :param pulumi.Input[float] password_max_lockout_attempts: Number of unsuccessful login attempts allowed before lockout: 0 = no limit.
        :param pulumi.Input[float] password_min_age_minutes: Minimum time interval in minutes between password changes: 0 = no limit.
        :param pulumi.Input[float] password_min_length: Minimum password length.
        :param pulumi.Input[float] password_min_lowercase: If a password must contain at least one lower case letter: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_number: If a password must contain at least one number: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_symbol: If a password must contain at least one symbol (!@#$%^&*): 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_uppercase: If a password must contain at least one upper case letter: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[bool] password_show_lockout_failures: If a user should be informed when their account is locked.
        :param pulumi.Input[float] priority: Policy Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an invalid
               priority is provided. API defaults it to the last/lowest if not there.
        :param pulumi.Input[float] question_min_length: Min length of the password recovery question answer.
        :param pulumi.Input[str] question_recovery: Enable or disable security question password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[float] recovery_email_token: Lifetime in minutes of the recovery email token.
        :param pulumi.Input[bool] skip_unlock: When an Active Directory user is locked out of Okta, the Okta unlock operation should also attempt to unlock the user's
               Windows account.
        :param pulumi.Input[str] sms_recovery: Enable or disable SMS password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[str] status: Policy Status: ACTIVE or INACTIVE.
        """
        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__['auth_provider'] = auth_provider
            __props__['description'] = description
            __props__['email_recovery'] = email_recovery
            __props__['groups_includeds'] = groups_includeds
            __props__['name'] = name
            __props__['password_auto_unlock_minutes'] = password_auto_unlock_minutes
            __props__['password_dictionary_lookup'] = password_dictionary_lookup
            __props__['password_exclude_first_name'] = password_exclude_first_name
            __props__['password_exclude_last_name'] = password_exclude_last_name
            __props__['password_exclude_username'] = password_exclude_username
            __props__['password_expire_warn_days'] = password_expire_warn_days
            __props__['password_history_count'] = password_history_count
            __props__['password_max_age_days'] = password_max_age_days
            __props__['password_max_lockout_attempts'] = password_max_lockout_attempts
            __props__['password_min_age_minutes'] = password_min_age_minutes
            __props__['password_min_length'] = password_min_length
            __props__['password_min_lowercase'] = password_min_lowercase
            __props__['password_min_number'] = password_min_number
            __props__['password_min_symbol'] = password_min_symbol
            __props__['password_min_uppercase'] = password_min_uppercase
            __props__['password_show_lockout_failures'] = password_show_lockout_failures
            __props__['priority'] = priority
            __props__['question_min_length'] = question_min_length
            __props__['question_recovery'] = question_recovery
            __props__['recovery_email_token'] = recovery_email_token
            __props__['skip_unlock'] = skip_unlock
            __props__['sms_recovery'] = sms_recovery
            __props__['status'] = status
        super(PasswordPolicy, __self__).__init__(
            'okta:deprecated/passwordPolicy:PasswordPolicy',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            auth_provider: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            email_recovery: Optional[pulumi.Input[str]] = None,
            groups_includeds: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            name: Optional[pulumi.Input[str]] = None,
            password_auto_unlock_minutes: Optional[pulumi.Input[float]] = None,
            password_dictionary_lookup: Optional[pulumi.Input[bool]] = None,
            password_exclude_first_name: Optional[pulumi.Input[bool]] = None,
            password_exclude_last_name: Optional[pulumi.Input[bool]] = None,
            password_exclude_username: Optional[pulumi.Input[bool]] = None,
            password_expire_warn_days: Optional[pulumi.Input[float]] = None,
            password_history_count: Optional[pulumi.Input[float]] = None,
            password_max_age_days: Optional[pulumi.Input[float]] = None,
            password_max_lockout_attempts: Optional[pulumi.Input[float]] = None,
            password_min_age_minutes: Optional[pulumi.Input[float]] = None,
            password_min_length: Optional[pulumi.Input[float]] = None,
            password_min_lowercase: Optional[pulumi.Input[float]] = None,
            password_min_number: Optional[pulumi.Input[float]] = None,
            password_min_symbol: Optional[pulumi.Input[float]] = None,
            password_min_uppercase: Optional[pulumi.Input[float]] = None,
            password_show_lockout_failures: Optional[pulumi.Input[bool]] = None,
            priority: Optional[pulumi.Input[float]] = None,
            question_min_length: Optional[pulumi.Input[float]] = None,
            question_recovery: Optional[pulumi.Input[str]] = None,
            recovery_email_token: Optional[pulumi.Input[float]] = None,
            skip_unlock: Optional[pulumi.Input[bool]] = None,
            sms_recovery: Optional[pulumi.Input[str]] = None,
            status: Optional[pulumi.Input[str]] = None) -> 'PasswordPolicy':
        """
        Get an existing PasswordPolicy 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 pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] auth_provider: Authentication Provider: OKTA or ACTIVE_DIRECTORY.
        :param pulumi.Input[str] description: Policy Description
        :param pulumi.Input[str] email_recovery: Enable or disable email password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[List[pulumi.Input[str]]] groups_includeds: List of Group IDs to Include
        :param pulumi.Input[str] name: Policy Name
        :param pulumi.Input[float] password_auto_unlock_minutes: Number of minutes before a locked account is unlocked: 0 = no limit.
        :param pulumi.Input[bool] password_dictionary_lookup: Check Passwords Against Common Password Dictionary.
        :param pulumi.Input[bool] password_exclude_first_name: User firstName attribute must be excluded from the password
        :param pulumi.Input[bool] password_exclude_last_name: User lastName attribute must be excluded from the password
        :param pulumi.Input[bool] password_exclude_username: If the user name must be excluded from the password.
        :param pulumi.Input[float] password_expire_warn_days: Length in days a user will be warned before password expiry: 0 = no warning.
        :param pulumi.Input[float] password_history_count: Number of distinct passwords that must be created before they can be reused: 0 = none.
        :param pulumi.Input[float] password_max_age_days: Length in days a password is valid before expiry: 0 = no limit.
        :param pulumi.Input[float] password_max_lockout_attempts: Number of unsuccessful login attempts allowed before lockout: 0 = no limit.
        :param pulumi.Input[float] password_min_age_minutes: Minimum time interval in minutes between password changes: 0 = no limit.
        :param pulumi.Input[float] password_min_length: Minimum password length.
        :param pulumi.Input[float] password_min_lowercase: If a password must contain at least one lower case letter: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_number: If a password must contain at least one number: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_symbol: If a password must contain at least one symbol (!@#$%^&*): 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[float] password_min_uppercase: If a password must contain at least one upper case letter: 0 = no, 1 = yes. Default = 1
        :param pulumi.Input[bool] password_show_lockout_failures: If a user should be informed when their account is locked.
        :param pulumi.Input[float] priority: Policy Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an invalid
               priority is provided. API defaults it to the last/lowest if not there.
        :param pulumi.Input[float] question_min_length: Min length of the password recovery question answer.
        :param pulumi.Input[str] question_recovery: Enable or disable security question password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[float] recovery_email_token: Lifetime in minutes of the recovery email token.
        :param pulumi.Input[bool] skip_unlock: When an Active Directory user is locked out of Okta, the Okta unlock operation should also attempt to unlock the user's
               Windows account.
        :param pulumi.Input[str] sms_recovery: Enable or disable SMS password recovery: ACTIVE or INACTIVE.
        :param pulumi.Input[str] status: Policy Status: ACTIVE or INACTIVE.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["auth_provider"] = auth_provider
        __props__["description"] = description
        __props__["email_recovery"] = email_recovery
        __props__["groups_includeds"] = groups_includeds
        __props__["name"] = name
        __props__["password_auto_unlock_minutes"] = password_auto_unlock_minutes
        __props__["password_dictionary_lookup"] = password_dictionary_lookup
        __props__["password_exclude_first_name"] = password_exclude_first_name
        __props__["password_exclude_last_name"] = password_exclude_last_name
        __props__["password_exclude_username"] = password_exclude_username
        __props__["password_expire_warn_days"] = password_expire_warn_days
        __props__["password_history_count"] = password_history_count
        __props__["password_max_age_days"] = password_max_age_days
        __props__["password_max_lockout_attempts"] = password_max_lockout_attempts
        __props__["password_min_age_minutes"] = password_min_age_minutes
        __props__["password_min_length"] = password_min_length
        __props__["password_min_lowercase"] = password_min_lowercase
        __props__["password_min_number"] = password_min_number
        __props__["password_min_symbol"] = password_min_symbol
        __props__["password_min_uppercase"] = password_min_uppercase
        __props__["password_show_lockout_failures"] = password_show_lockout_failures
        __props__["priority"] = priority
        __props__["question_min_length"] = question_min_length
        __props__["question_recovery"] = question_recovery
        __props__["recovery_email_token"] = recovery_email_token
        __props__["skip_unlock"] = skip_unlock
        __props__["sms_recovery"] = sms_recovery
        __props__["status"] = status
        return PasswordPolicy(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="authProvider")
    def auth_provider(self) -> pulumi.Output[Optional[str]]:
        """
        Authentication Provider: OKTA or ACTIVE_DIRECTORY.
        """
        return pulumi.get(self, "auth_provider")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Policy Description
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="emailRecovery")
    def email_recovery(self) -> pulumi.Output[Optional[str]]:
        """
        Enable or disable email password recovery: ACTIVE or INACTIVE.
        """
        return pulumi.get(self, "email_recovery")

    @property
    @pulumi.getter(name="groupsIncludeds")
    def groups_includeds(self) -> pulumi.Output[Optional[List[str]]]:
        """
        List of Group IDs to Include
        """
        return pulumi.get(self, "groups_includeds")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Policy Name
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="passwordAutoUnlockMinutes")
    def password_auto_unlock_minutes(self) -> pulumi.Output[Optional[float]]:
        """
        Number of minutes before a locked account is unlocked: 0 = no limit.
        """
        return pulumi.get(self, "password_auto_unlock_minutes")

    @property
    @pulumi.getter(name="passwordDictionaryLookup")
    def password_dictionary_lookup(self) -> pulumi.Output[Optional[bool]]:
        """
        Check Passwords Against Common Password Dictionary.
        """
        return pulumi.get(self, "password_dictionary_lookup")

    @property
    @pulumi.getter(name="passwordExcludeFirstName")
    def password_exclude_first_name(self) -> pulumi.Output[Optional[bool]]:
        """
        User firstName attribute must be excluded from the password
        """
        return pulumi.get(self, "password_exclude_first_name")

    @property
    @pulumi.getter(name="passwordExcludeLastName")
    def password_exclude_last_name(self) -> pulumi.Output[Optional[bool]]:
        """
        User lastName attribute must be excluded from the password
        """
        return pulumi.get(self, "password_exclude_last_name")

    @property
    @pulumi.getter(name="passwordExcludeUsername")
    def password_exclude_username(self) -> pulumi.Output[Optional[bool]]:
        """
        If the user name must be excluded from the password.
        """
        return pulumi.get(self, "password_exclude_username")

    @property
    @pulumi.getter(name="passwordExpireWarnDays")
    def password_expire_warn_days(self) -> pulumi.Output[Optional[float]]:
        """
        Length in days a user will be warned before password expiry: 0 = no warning.
        """
        return pulumi.get(self, "password_expire_warn_days")

    @property
    @pulumi.getter(name="passwordHistoryCount")
    def password_history_count(self) -> pulumi.Output[Optional[float]]:
        """
        Number of distinct passwords that must be created before they can be reused: 0 = none.
        """
        return pulumi.get(self, "password_history_count")

    @property
    @pulumi.getter(name="passwordMaxAgeDays")
    def password_max_age_days(self) -> pulumi.Output[Optional[float]]:
        """
        Length in days a password is valid before expiry: 0 = no limit.
        """
        return pulumi.get(self, "password_max_age_days")

    @property
    @pulumi.getter(name="passwordMaxLockoutAttempts")
    def password_max_lockout_attempts(self) -> pulumi.Output[Optional[float]]:
        """
        Number of unsuccessful login attempts allowed before lockout: 0 = no limit.
        """
        return pulumi.get(self, "password_max_lockout_attempts")

    @property
    @pulumi.getter(name="passwordMinAgeMinutes")
    def password_min_age_minutes(self) -> pulumi.Output[Optional[float]]:
        """
        Minimum time interval in minutes between password changes: 0 = no limit.
        """
        return pulumi.get(self, "password_min_age_minutes")

    @property
    @pulumi.getter(name="passwordMinLength")
    def password_min_length(self) -> pulumi.Output[Optional[float]]:
        """
        Minimum password length.
        """
        return pulumi.get(self, "password_min_length")

    @property
    @pulumi.getter(name="passwordMinLowercase")
    def password_min_lowercase(self) -> pulumi.Output[Optional[float]]:
        """
        If a password must contain at least one lower case letter: 0 = no, 1 = yes. Default = 1
        """
        return pulumi.get(self, "password_min_lowercase")

    @property
    @pulumi.getter(name="passwordMinNumber")
    def password_min_number(self) -> pulumi.Output[Optional[float]]:
        """
        If a password must contain at least one number: 0 = no, 1 = yes. Default = 1
        """
        return pulumi.get(self, "password_min_number")

    @property
    @pulumi.getter(name="passwordMinSymbol")
    def password_min_symbol(self) -> pulumi.Output[Optional[float]]:
        """
        If a password must contain at least one symbol (!@#$%^&*): 0 = no, 1 = yes. Default = 1
        """
        return pulumi.get(self, "password_min_symbol")

    @property
    @pulumi.getter(name="passwordMinUppercase")
    def password_min_uppercase(self) -> pulumi.Output[Optional[float]]:
        """
        If a password must contain at least one upper case letter: 0 = no, 1 = yes. Default = 1
        """
        return pulumi.get(self, "password_min_uppercase")

    @property
    @pulumi.getter(name="passwordShowLockoutFailures")
    def password_show_lockout_failures(self) -> pulumi.Output[Optional[bool]]:
        """
        If a user should be informed when their account is locked.
        """
        return pulumi.get(self, "password_show_lockout_failures")

    @property
    @pulumi.getter
    def priority(self) -> pulumi.Output[Optional[float]]:
        """
        Policy Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an invalid
        priority is provided. API defaults it to the last/lowest if not there.
        """
        return pulumi.get(self, "priority")

    @property
    @pulumi.getter(name="questionMinLength")
    def question_min_length(self) -> pulumi.Output[Optional[float]]:
        """
        Min length of the password recovery question answer.
        """
        return pulumi.get(self, "question_min_length")

    @property
    @pulumi.getter(name="questionRecovery")
    def question_recovery(self) -> pulumi.Output[Optional[str]]:
        """
        Enable or disable security question password recovery: ACTIVE or INACTIVE.
        """
        return pulumi.get(self, "question_recovery")

    @property
    @pulumi.getter(name="recoveryEmailToken")
    def recovery_email_token(self) -> pulumi.Output[Optional[float]]:
        """
        Lifetime in minutes of the recovery email token.
        """
        return pulumi.get(self, "recovery_email_token")

    @property
    @pulumi.getter(name="skipUnlock")
    def skip_unlock(self) -> pulumi.Output[Optional[bool]]:
        """
        When an Active Directory user is locked out of Okta, the Okta unlock operation should also attempt to unlock the user's
        Windows account.
        """
        return pulumi.get(self, "skip_unlock")

    @property
    @pulumi.getter(name="smsRecovery")
    def sms_recovery(self) -> pulumi.Output[Optional[str]]:
        """
        Enable or disable SMS password recovery: ACTIVE or INACTIVE.
        """
        return pulumi.get(self, "sms_recovery")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[Optional[str]]:
        """
        Policy Status: ACTIVE or INACTIVE.
        """
        return pulumi.get(self, "status")

    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

