# 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 ScalingConfiguration(pulumi.CustomResource):
    active: pulumi.Output[bool]
    """
    Whether active current scaling configuration in the specified scaling group. Default to `false`.
    """
    data_disks: pulumi.Output[list]
    """
    DataDisk mappings to attach to ecs instance. See Block datadisk below for details.
    
      * `category` (`str`)
      * `delete_with_instance` (`bool`)
      * `device` (`str`)
      * `size` (`float`)
      * `snapshot_id` (`str`)
    """
    enable: pulumi.Output[bool]
    """
    Whether enable the specified scaling group(make it active) to which the current scaling configuration belongs.
    """
    force_delete: pulumi.Output[bool]
    """
    The last scaling configuration will be deleted forcibly with deleting its scaling group. Default to false.
    """
    image_id: pulumi.Output[str]
    """
    ID of an image file, indicating the image resource selected when an instance is enabled.
    """
    instance_ids: pulumi.Output[list]
    """
    It has been deprecated from version 1.6.0. New resource `ess.Attachment` replaces it.
    """
    instance_name: pulumi.Output[str]
    """
    Name of an ECS instance. Default to "ESS-Instance". It is valid from version 1.7.1.
    """
    instance_type: pulumi.Output[str]
    """
    Resource type of an ECS instance.
    """
    instance_types: pulumi.Output[list]
    """
    Resource types of an ECS instance.
    """
    internet_charge_type: pulumi.Output[str]
    """
    Network billing type, Values: PayByBandwidth or PayByTraffic. Default to `PayByBandwidth`.
    """
    internet_max_bandwidth_in: pulumi.Output[float]
    """
    Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). The value range is [1,200].
    """
    internet_max_bandwidth_out: pulumi.Output[float]
    """
    Maximum outgoing bandwidth from the public network, measured in Mbps (Mega bit per second). The value range for PayByBandwidth is [0,100].
    """
    io_optimized: pulumi.Output[str]
    """
    It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
    """
    is_outdated: pulumi.Output[bool]
    """
    Whether to use outdated instance type. Default to false.
    """
    key_name: pulumi.Output[str]
    """
    The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
    """
    kms_encrypted_password: pulumi.Output[str]
    """
    An KMS encrypts password used to a db account. If the `password` is filled in, this field will be ignored.
    """
    kms_encryption_context: pulumi.Output[dict]
    """
    An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating a db account with `kms_encrypted_password`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kms_encrypted_password` is set.
    """
    override: pulumi.Output[bool]
    """
    Indicates whether to overwrite the existing data. Default to false.
    """
    password: pulumi.Output[str]
    """
    The password of the ECS instance. The password must be 8 to 30 characters in length. It must contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `() ~!@#$%^&*-_+=\|{}[]:;'<>,.?/`, The password of Windows-based instances cannot start with a forward slash (/).
    """
    password_inherit: pulumi.Output[bool]
    """
    Specifies whether to use the password that is predefined in the image. If the PasswordInherit parameter is set to true, the `password` and `kms_encrypted_password` will be ignored. You must ensure that the selected image has a password configured.
    """
    role_name: pulumi.Output[str]
    """
    Instance RAM role name. The name is provided and maintained by RAM. You can use `ram.Role` to create a new one.
    """
    scaling_configuration_name: pulumi.Output[str]
    """
    Name shown for the scheduled task. which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores `_`, hypens `-`, and decimal point `.`. If this parameter value is not specified, the default value is ScalingConfigurationId.
    """
    scaling_group_id: pulumi.Output[str]
    """
    ID of the scaling group of a scaling configuration.
    """
    security_group_id: pulumi.Output[str]
    """
    ID of the security group used to create new instance. It is conflict with `security_group_ids`.
    """
    security_group_ids: pulumi.Output[list]
    """
    List IDs of the security group used to create new instances. It is conflict with `security_group_id`.
    """
    substitute: pulumi.Output[str]
    """
    The another scaling configuration which will be active automatically and replace current configuration when setting `active` to 'false'. It is invalid when `active` is 'true'.
    """
    system_disk_category: pulumi.Output[str]
    """
    Category of the system disk. The parameter value options are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd` and `cloud`. `cloud` only is used to some no I/O optimized instance. Default to `cloud_efficiency`.
    """
    system_disk_size: pulumi.Output[float]
    """
    Size of system disk, in GiB. Optional values: cloud: 20-500, cloud_efficiency: 20-500, cloud_ssd: 20-500, ephemeral_ssd: 20-500 The default value is max{40, ImageSize}. If this parameter is set, the system disk size must be greater than or equal to max{40, ImageSize}.
    """
    tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the resource. It will be applied for ECS instances finally.
    - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "http://", or "https://". It cannot be a null string.
    - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "http://", or "https://" It can be a null string.
    """
    user_data: pulumi.Output[str]
    """
    User-defined data to customize the startup behaviors of the ECS instance and to pass data into the ECS instance.
    """
    def __init__(__self__, resource_name, opts=None, active=None, data_disks=None, enable=None, force_delete=None, image_id=None, instance_ids=None, instance_name=None, instance_type=None, instance_types=None, internet_charge_type=None, internet_max_bandwidth_in=None, internet_max_bandwidth_out=None, io_optimized=None, is_outdated=None, key_name=None, kms_encrypted_password=None, kms_encryption_context=None, override=None, password=None, password_inherit=None, role_name=None, scaling_configuration_name=None, scaling_group_id=None, security_group_id=None, security_group_ids=None, substitute=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a ScalingConfiguration 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] active: Whether active current scaling configuration in the specified scaling group. Default to `false`.
        :param pulumi.Input[list] data_disks: DataDisk mappings to attach to ecs instance. See Block datadisk below for details.
        :param pulumi.Input[bool] enable: Whether enable the specified scaling group(make it active) to which the current scaling configuration belongs.
        :param pulumi.Input[bool] force_delete: The last scaling configuration will be deleted forcibly with deleting its scaling group. Default to false.
        :param pulumi.Input[str] image_id: ID of an image file, indicating the image resource selected when an instance is enabled.
        :param pulumi.Input[list] instance_ids: It has been deprecated from version 1.6.0. New resource `ess.Attachment` replaces it.
        :param pulumi.Input[str] instance_name: Name of an ECS instance. Default to "ESS-Instance". It is valid from version 1.7.1.
        :param pulumi.Input[str] instance_type: Resource type of an ECS instance.
        :param pulumi.Input[list] instance_types: Resource types of an ECS instance.
        :param pulumi.Input[str] internet_charge_type: Network billing type, Values: PayByBandwidth or PayByTraffic. Default to `PayByBandwidth`.
        :param pulumi.Input[float] internet_max_bandwidth_in: Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). The value range is [1,200].
        :param pulumi.Input[float] internet_max_bandwidth_out: Maximum outgoing bandwidth from the public network, measured in Mbps (Mega bit per second). The value range for PayByBandwidth is [0,100].
        :param pulumi.Input[str] io_optimized: It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
        :param pulumi.Input[bool] is_outdated: Whether to use outdated instance type. Default to false.
        :param pulumi.Input[str] key_name: The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
        :param pulumi.Input[str] kms_encrypted_password: An KMS encrypts password used to a db account. If the `password` is filled in, this field will be ignored.
        :param pulumi.Input[dict] kms_encryption_context: An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating a db account with `kms_encrypted_password`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kms_encrypted_password` is set.
        :param pulumi.Input[bool] override: Indicates whether to overwrite the existing data. Default to false.
        :param pulumi.Input[str] password: The password of the ECS instance. The password must be 8 to 30 characters in length. It must contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `() ~!@#$%^&*-_+=\|{}[]:;'<>,.?/`, The password of Windows-based instances cannot start with a forward slash (/).
        :param pulumi.Input[bool] password_inherit: Specifies whether to use the password that is predefined in the image. If the PasswordInherit parameter is set to true, the `password` and `kms_encrypted_password` will be ignored. You must ensure that the selected image has a password configured.
        :param pulumi.Input[str] role_name: Instance RAM role name. The name is provided and maintained by RAM. You can use `ram.Role` to create a new one.
        :param pulumi.Input[str] scaling_configuration_name: Name shown for the scheduled task. which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores `_`, hypens `-`, and decimal point `.`. If this parameter value is not specified, the default value is ScalingConfigurationId.
        :param pulumi.Input[str] scaling_group_id: ID of the scaling group of a scaling configuration.
        :param pulumi.Input[str] security_group_id: ID of the security group used to create new instance. It is conflict with `security_group_ids`.
        :param pulumi.Input[list] security_group_ids: List IDs of the security group used to create new instances. It is conflict with `security_group_id`.
        :param pulumi.Input[str] substitute: The another scaling configuration which will be active automatically and replace current configuration when setting `active` to 'false'. It is invalid when `active` is 'true'.
        :param pulumi.Input[str] system_disk_category: Category of the system disk. The parameter value options are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd` and `cloud`. `cloud` only is used to some no I/O optimized instance. Default to `cloud_efficiency`.
        :param pulumi.Input[float] system_disk_size: Size of system disk, in GiB. Optional values: cloud: 20-500, cloud_efficiency: 20-500, cloud_ssd: 20-500, ephemeral_ssd: 20-500 The default value is max{40, ImageSize}. If this parameter is set, the system disk size must be greater than or equal to max{40, ImageSize}.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource. It will be applied for ECS instances finally.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "http://", or "https://" It can be a null string.
        :param pulumi.Input[str] user_data: User-defined data to customize the startup behaviors of the ECS instance and to pass data into the ECS instance.
        
        The **data_disks** object supports the following:
        
          * `category` (`pulumi.Input[str]`)
          * `delete_with_instance` (`pulumi.Input[bool]`)
          * `device` (`pulumi.Input[str]`)
          * `size` (`pulumi.Input[float]`)
          * `snapshot_id` (`pulumi.Input[str]`)

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/ess_scaling_configuration.html.markdown.
        """
        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__['active'] = active
            __props__['data_disks'] = data_disks
            __props__['enable'] = enable
            __props__['force_delete'] = force_delete
            if image_id is None:
                raise TypeError("Missing required property 'image_id'")
            __props__['image_id'] = image_id
            __props__['instance_ids'] = instance_ids
            __props__['instance_name'] = instance_name
            __props__['instance_type'] = instance_type
            __props__['instance_types'] = instance_types
            __props__['internet_charge_type'] = internet_charge_type
            __props__['internet_max_bandwidth_in'] = internet_max_bandwidth_in
            __props__['internet_max_bandwidth_out'] = internet_max_bandwidth_out
            __props__['io_optimized'] = io_optimized
            __props__['is_outdated'] = is_outdated
            __props__['key_name'] = key_name
            __props__['kms_encrypted_password'] = kms_encrypted_password
            __props__['kms_encryption_context'] = kms_encryption_context
            __props__['override'] = override
            __props__['password'] = password
            __props__['password_inherit'] = password_inherit
            __props__['role_name'] = role_name
            __props__['scaling_configuration_name'] = scaling_configuration_name
            if scaling_group_id is None:
                raise TypeError("Missing required property 'scaling_group_id'")
            __props__['scaling_group_id'] = scaling_group_id
            __props__['security_group_id'] = security_group_id
            __props__['security_group_ids'] = security_group_ids
            __props__['substitute'] = substitute
            __props__['system_disk_category'] = system_disk_category
            __props__['system_disk_size'] = system_disk_size
            __props__['tags'] = tags
            __props__['user_data'] = user_data
        super(ScalingConfiguration, __self__).__init__(
            'alicloud:ess/scalingConfiguration:ScalingConfiguration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, active=None, data_disks=None, enable=None, force_delete=None, image_id=None, instance_ids=None, instance_name=None, instance_type=None, instance_types=None, internet_charge_type=None, internet_max_bandwidth_in=None, internet_max_bandwidth_out=None, io_optimized=None, is_outdated=None, key_name=None, kms_encrypted_password=None, kms_encryption_context=None, override=None, password=None, password_inherit=None, role_name=None, scaling_configuration_name=None, scaling_group_id=None, security_group_id=None, security_group_ids=None, substitute=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None):
        """
        Get an existing ScalingConfiguration 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] active: Whether active current scaling configuration in the specified scaling group. Default to `false`.
        :param pulumi.Input[list] data_disks: DataDisk mappings to attach to ecs instance. See Block datadisk below for details.
        :param pulumi.Input[bool] enable: Whether enable the specified scaling group(make it active) to which the current scaling configuration belongs.
        :param pulumi.Input[bool] force_delete: The last scaling configuration will be deleted forcibly with deleting its scaling group. Default to false.
        :param pulumi.Input[str] image_id: ID of an image file, indicating the image resource selected when an instance is enabled.
        :param pulumi.Input[list] instance_ids: It has been deprecated from version 1.6.0. New resource `ess.Attachment` replaces it.
        :param pulumi.Input[str] instance_name: Name of an ECS instance. Default to "ESS-Instance". It is valid from version 1.7.1.
        :param pulumi.Input[str] instance_type: Resource type of an ECS instance.
        :param pulumi.Input[list] instance_types: Resource types of an ECS instance.
        :param pulumi.Input[str] internet_charge_type: Network billing type, Values: PayByBandwidth or PayByTraffic. Default to `PayByBandwidth`.
        :param pulumi.Input[float] internet_max_bandwidth_in: Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). The value range is [1,200].
        :param pulumi.Input[float] internet_max_bandwidth_out: Maximum outgoing bandwidth from the public network, measured in Mbps (Mega bit per second). The value range for PayByBandwidth is [0,100].
        :param pulumi.Input[str] io_optimized: It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
        :param pulumi.Input[bool] is_outdated: Whether to use outdated instance type. Default to false.
        :param pulumi.Input[str] key_name: The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
        :param pulumi.Input[str] kms_encrypted_password: An KMS encrypts password used to a db account. If the `password` is filled in, this field will be ignored.
        :param pulumi.Input[dict] kms_encryption_context: An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating a db account with `kms_encrypted_password`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kms_encrypted_password` is set.
        :param pulumi.Input[bool] override: Indicates whether to overwrite the existing data. Default to false.
        :param pulumi.Input[str] password: The password of the ECS instance. The password must be 8 to 30 characters in length. It must contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `() ~!@#$%^&*-_+=\|{}[]:;'<>,.?/`, The password of Windows-based instances cannot start with a forward slash (/).
        :param pulumi.Input[bool] password_inherit: Specifies whether to use the password that is predefined in the image. If the PasswordInherit parameter is set to true, the `password` and `kms_encrypted_password` will be ignored. You must ensure that the selected image has a password configured.
        :param pulumi.Input[str] role_name: Instance RAM role name. The name is provided and maintained by RAM. You can use `ram.Role` to create a new one.
        :param pulumi.Input[str] scaling_configuration_name: Name shown for the scheduled task. which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores `_`, hypens `-`, and decimal point `.`. If this parameter value is not specified, the default value is ScalingConfigurationId.
        :param pulumi.Input[str] scaling_group_id: ID of the scaling group of a scaling configuration.
        :param pulumi.Input[str] security_group_id: ID of the security group used to create new instance. It is conflict with `security_group_ids`.
        :param pulumi.Input[list] security_group_ids: List IDs of the security group used to create new instances. It is conflict with `security_group_id`.
        :param pulumi.Input[str] substitute: The another scaling configuration which will be active automatically and replace current configuration when setting `active` to 'false'. It is invalid when `active` is 'true'.
        :param pulumi.Input[str] system_disk_category: Category of the system disk. The parameter value options are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd` and `cloud`. `cloud` only is used to some no I/O optimized instance. Default to `cloud_efficiency`.
        :param pulumi.Input[float] system_disk_size: Size of system disk, in GiB. Optional values: cloud: 20-500, cloud_efficiency: 20-500, cloud_ssd: 20-500, ephemeral_ssd: 20-500 The default value is max{40, ImageSize}. If this parameter is set, the system disk size must be greater than or equal to max{40, ImageSize}.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource. It will be applied for ECS instances finally.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "http://", or "https://" It can be a null string.
        :param pulumi.Input[str] user_data: User-defined data to customize the startup behaviors of the ECS instance and to pass data into the ECS instance.
        
        The **data_disks** object supports the following:
        
          * `category` (`pulumi.Input[str]`)
          * `delete_with_instance` (`pulumi.Input[bool]`)
          * `device` (`pulumi.Input[str]`)
          * `size` (`pulumi.Input[float]`)
          * `snapshot_id` (`pulumi.Input[str]`)

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/ess_scaling_configuration.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["active"] = active
        __props__["data_disks"] = data_disks
        __props__["enable"] = enable
        __props__["force_delete"] = force_delete
        __props__["image_id"] = image_id
        __props__["instance_ids"] = instance_ids
        __props__["instance_name"] = instance_name
        __props__["instance_type"] = instance_type
        __props__["instance_types"] = instance_types
        __props__["internet_charge_type"] = internet_charge_type
        __props__["internet_max_bandwidth_in"] = internet_max_bandwidth_in
        __props__["internet_max_bandwidth_out"] = internet_max_bandwidth_out
        __props__["io_optimized"] = io_optimized
        __props__["is_outdated"] = is_outdated
        __props__["key_name"] = key_name
        __props__["kms_encrypted_password"] = kms_encrypted_password
        __props__["kms_encryption_context"] = kms_encryption_context
        __props__["override"] = override
        __props__["password"] = password
        __props__["password_inherit"] = password_inherit
        __props__["role_name"] = role_name
        __props__["scaling_configuration_name"] = scaling_configuration_name
        __props__["scaling_group_id"] = scaling_group_id
        __props__["security_group_id"] = security_group_id
        __props__["security_group_ids"] = security_group_ids
        __props__["substitute"] = substitute
        __props__["system_disk_category"] = system_disk_category
        __props__["system_disk_size"] = system_disk_size
        __props__["tags"] = tags
        __props__["user_data"] = user_data
        return ScalingConfiguration(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

