# 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 Instance(pulumi.CustomResource):
    allocate_public_ip: pulumi.Output[bool]
    """
    It has been deprecated from version "1.7.0". Setting "internet_max_bandwidth_out" larger than 0 can allocate a public ip address for an instance.
    """
    auto_release_time: pulumi.Output[str]
    """
    The automatic release time of the `PostPaid` instance. 
    The time follows the ISO 8601 standard and is in UTC time. Format: yyyy-MM-ddTHH:mm:ssZ. It must be at least half an hour later than the current time and less than 3 years since the current time.
    Set it to null can cancel automatic release attribute and the ECS instance will not be released automatically.
    """
    auto_renew_period: pulumi.Output[float]
    """
    Auto renewal period of an instance, in the unit of month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid value:
    - [1, 2, 3, 6, 12] when `period_unit` in "Month"
    - [1, 2, 3] when `period_unit` in "Week"
    """
    availability_zone: pulumi.Output[str]
    """
    The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
    """
    credit_specification: pulumi.Output[str]
    """
    Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
    """
    data_disks: pulumi.Output[list]
    """
    The list of data disks created with instance.
    
      * `category` (`str`) - The category of the disk:
        - `cloud`: The general cloud disk.
        - `cloud_efficiency`: The efficiency cloud disk.
        - `cloud_ssd`: The SSD cloud disk.
        - `cloud_essd`: The ESSD cloud disk.
        - `ephemeral_ssd`: The local SSD disk.
        Default to `cloud_efficiency`.
        * `encrypted` -(Optional, Bool, ForceNew) Encrypted the data in this disk.
      * `delete_with_instance` (`bool`) - Delete this data disk when the instance is destroyed. It only works on cloud, cloud_efficiency, cloud_essd, cloud_ssd disk. If the category of this data disk was ephemeral_ssd, please don't set this param.
      * `description` (`str`) - The description of the data disk.
      * `encrypted` (`bool`)
      * `name` (`str`) - The name of the data disk.
      * `size` (`float`) - The size of the data disk.
        - cloud：[5, 2000]
        - cloud_efficiency：[20, 32768]
        - cloud_ssd：[20, 32768]
        - cloud_essd：[20, 32768]
        - ephemeral_ssd: [5, 800]
      * `snapshot_id` (`str`) - The snapshot ID used to initialize the data disk. If the size specified by snapshot is greater that the size of the disk, use the size specified by snapshot as the size of the data disk.
    """
    deletion_protection: pulumi.Output[bool]
    """
    Whether enable the deletion protection or not.
    - true: Enable deletion protection.
    - false: Disable deletion protection.
    """
    description: pulumi.Output[str]
    """
    The description of the data disk.
    """
    dry_run: pulumi.Output[bool]
    """
    Specifies whether to send a dry-run request. Default to false. 
    - true: Only a dry-run request is sent and no instance is created. The system checks whether the required parameters are set, and validates the request format, service permissions, and available ECS instances. If the validation fails, the corresponding error code is returned. If the validation succeeds, the `DryRunOperation` error code is returned.
    - false: A request is sent. If the validation succeeds, the instance is created.
    """
    force_delete: pulumi.Output[bool]
    """
    If it is true, the "PrePaid" instance will be change to "PostPaid" and then deleted forcibly.
    However, because of changing instance charge type has CPU core count quota limitation, so strongly recommand that "Don't modify instance charge type frequentlly in one month".
    """
    host_name: pulumi.Output[str]
    """
    Host name of the ECS, which is a string of at least two characters. “hostname” cannot start or end with “.” or “-“. In addition, two or more consecutive “.” or “-“ symbols are not allowed. On Windows, the host name can contain a maximum of 15 characters, which can be a combination of uppercase/lowercase letters, numerals, and “-“. The host name cannot contain dots (“.”) or contain only numeric characters. When it is changed, the instance will reboot to make the change take effect.
    On other OSs such as Linux, the host name can contain a maximum of 30 characters, which can be segments separated by dots (“.”), where each segment can contain uppercase/lowercase letters, numerals, or “_“. When it is changed, the instance will reboot to make the change take effect.
    """
    image_id: pulumi.Output[str]
    """
    The Image to use for the instance. ECS instance's image can be replaced via changing 'image_id'. When it is changed, the instance will reboot to make the change take effect.
    """
    include_data_disks: pulumi.Output[bool]
    """
    Whether to change instance disks charge type when changing instance charge type.
    """
    instance_charge_type: pulumi.Output[str]
    """
    Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
    """
    instance_name: pulumi.Output[str]
    instance_type: pulumi.Output[str]
    """
    The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
    """
    internet_charge_type: pulumi.Output[str]
    """
    Internet charge type of the instance, Valid values are `PayByBandwidth`, `PayByTraffic`. Default is `PayByTraffic`. At present, 'PrePaid' instance cannot change the value to "PayByBandwidth" from "PayByTraffic".
    """
    internet_max_bandwidth_in: pulumi.Output[float]
    """
    Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). Value range: [1, 200]. If this value is not specified, then automatically sets it to 200 Mbps.
    """
    internet_max_bandwidth_out: pulumi.Output[float]
    """
    Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
    """
    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 an instance. If the `password` is filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.
    """
    kms_encryption_context: pulumi.Output[dict]
    """
    An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance 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. When it is changed, the instance will reboot to make the change take effect.
    """
    password: pulumi.Output[str]
    """
    Password to an instance is a string of 8 to 30 characters. It must contain uppercase/lowercase letters and numerals, but cannot contain special symbols. When it is changed, the instance will reboot to make the change take effect.
    """
    period: pulumi.Output[float]
    """
    The duration that you will buy the resource, in month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid values:
    - [1-9, 12, 24, 36, 48, 60] when `period_unit` in "Month"
    - [1-3] when `period_unit` in "Week"
    """
    period_unit: pulumi.Output[str]
    """
    The duration unit that you will buy the resource. It is valid when `instance_charge_type` is 'PrePaid'. Valid value: ["Week", "Month"]. Default to "Month".
    """
    private_ip: pulumi.Output[str]
    """
    Instance private IP address can be specified when you creating new instance. It is valid when `vswitch_id` is specified. When it is changed, the instance will reboot to make the change take effect.
    """
    public_ip: pulumi.Output[str]
    """
    The instance public ip.
    """
    renewal_status: pulumi.Output[str]
    """
    Whether to renew an ECS instance automatically or not. It is valid when `instance_charge_type` is `PrePaid`. Default to "Normal". Valid values:
    - `AutoRenewal`: Enable auto renewal.
    - `Normal`: Disable auto renewal.
    - `NotRenewal`: No renewal any longer. After you specify this value, Alibaba Cloud stop sending notification of instance expiry, and only gives a brief reminder on the third day before the instance expiry.
    """
    resource_group_id: pulumi.Output[str]
    """
    The Id of resource group which the instance belongs.
    """
    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.
    """
    security_enhancement_strategy: pulumi.Output[str]
    """
    The security enhancement strategy.
    - Active: Enable security enhancement strategy, it only works on system images.
    - Deactive: Disable security enhancement strategy, it works on all images.
    """
    security_groups: pulumi.Output[list]
    """
    A list of security group ids to associate with.
    """
    spot_price_limit: pulumi.Output[float]
    """
    The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
    """
    spot_strategy: pulumi.Output[str]
    """
    The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter `instance_charge_type` is 'PostPaid'. Value range:
    - NoSpot: A regular Pay-As-You-Go instance.
    - SpotWithPriceLimit: A price threshold for a spot instance
    - SpotAsPriceGo: A price that is based on the highest Pay-As-You-Go instance
    """
    status: pulumi.Output[str]
    """
    The instance status.
    """
    subnet_id: pulumi.Output[str]
    system_disk_category: pulumi.Output[str]
    """
    Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`. `cloud` only is used to some none I/O optimized instance. Default to `cloud_efficiency`.
    """
    system_disk_size: pulumi.Output[float]
    """
    Size of the system disk, measured in GiB. Value range: [20, 500]. The specified value must be equal to or greater than max{20, Imagesize}. Default value: max{40, ImageSize}. ECS instance's system disk can be reset when replacing system disk. When it is changed, the instance will reboot to make the change take effect.
    """
    tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the resource.
    - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
    - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
    """
    user_data: pulumi.Output[str]
    """
    User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance. From version 1.60.0, it can be update in-place. If updated, the instance will reboot to make the change take effect. Note: Not all of changes will take effect and it depends on [cloud-init module type](https://cloudinit.readthedocs.io/en/latest/topics/modules.html).
    """
    volume_tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the devices created by the instance at launch time.
    - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
    - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
    """
    vswitch_id: pulumi.Output[str]
    """
    The virtual switch ID to launch in VPC. This parameter must be set unless you can create classic network instances. When it is changed, the instance will reboot to make the change take effect.
    """
    def __init__(__self__, resource_name, opts=None, allocate_public_ip=None, auto_release_time=None, auto_renew_period=None, availability_zone=None, credit_specification=None, data_disks=None, deletion_protection=None, description=None, dry_run=None, force_delete=None, host_name=None, image_id=None, include_data_disks=None, instance_charge_type=None, instance_name=None, instance_type=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, password=None, period=None, period_unit=None, private_ip=None, renewal_status=None, resource_group_id=None, role_name=None, security_enhancement_strategy=None, security_groups=None, spot_price_limit=None, spot_strategy=None, subnet_id=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None, volume_tags=None, vswitch_id=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Instance 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] allocate_public_ip: It has been deprecated from version "1.7.0". Setting "internet_max_bandwidth_out" larger than 0 can allocate a public ip address for an instance.
        :param pulumi.Input[str] auto_release_time: The automatic release time of the `PostPaid` instance. 
               The time follows the ISO 8601 standard and is in UTC time. Format: yyyy-MM-ddTHH:mm:ssZ. It must be at least half an hour later than the current time and less than 3 years since the current time.
               Set it to null can cancel automatic release attribute and the ECS instance will not be released automatically.
        :param pulumi.Input[float] auto_renew_period: Auto renewal period of an instance, in the unit of month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid value:
               - [1, 2, 3, 6, 12] when `period_unit` in "Month"
               - [1, 2, 3] when `period_unit` in "Week"
        :param pulumi.Input[str] availability_zone: The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
        :param pulumi.Input[str] credit_specification: Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
        :param pulumi.Input[list] data_disks: The list of data disks created with instance.
        :param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
               - true: Enable deletion protection.
               - false: Disable deletion protection.
        :param pulumi.Input[str] description: The description of the data disk.
        :param pulumi.Input[bool] dry_run: Specifies whether to send a dry-run request. Default to false. 
               - true: Only a dry-run request is sent and no instance is created. The system checks whether the required parameters are set, and validates the request format, service permissions, and available ECS instances. If the validation fails, the corresponding error code is returned. If the validation succeeds, the `DryRunOperation` error code is returned.
               - false: A request is sent. If the validation succeeds, the instance is created.
        :param pulumi.Input[bool] force_delete: If it is true, the "PrePaid" instance will be change to "PostPaid" and then deleted forcibly.
               However, because of changing instance charge type has CPU core count quota limitation, so strongly recommand that "Don't modify instance charge type frequentlly in one month".
        :param pulumi.Input[str] host_name: Host name of the ECS, which is a string of at least two characters. “hostname” cannot start or end with “.” or “-“. In addition, two or more consecutive “.” or “-“ symbols are not allowed. On Windows, the host name can contain a maximum of 15 characters, which can be a combination of uppercase/lowercase letters, numerals, and “-“. The host name cannot contain dots (“.”) or contain only numeric characters. When it is changed, the instance will reboot to make the change take effect.
               On other OSs such as Linux, the host name can contain a maximum of 30 characters, which can be segments separated by dots (“.”), where each segment can contain uppercase/lowercase letters, numerals, or “_“. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] image_id: The Image to use for the instance. ECS instance's image can be replaced via changing 'image_id'. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[bool] include_data_disks: Whether to change instance disks charge type when changing instance charge type.
        :param pulumi.Input[str] instance_charge_type: Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
        :param pulumi.Input[str] instance_type: The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] internet_charge_type: Internet charge type of the instance, Valid values are `PayByBandwidth`, `PayByTraffic`. Default is `PayByTraffic`. At present, 'PrePaid' instance cannot change the value to "PayByBandwidth" from "PayByTraffic".
        :param pulumi.Input[float] internet_max_bandwidth_in: Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). Value range: [1, 200]. If this value is not specified, then automatically sets it to 200 Mbps.
        :param pulumi.Input[float] internet_max_bandwidth_out: Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
        :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 an instance. If the `password` is filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[dict] kms_encryption_context: An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance 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. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] password: Password to an instance is a string of 8 to 30 characters. It must contain uppercase/lowercase letters and numerals, but cannot contain special symbols. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[float] period: The duration that you will buy the resource, in month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid values:
               - [1-9, 12, 24, 36, 48, 60] when `period_unit` in "Month"
               - [1-3] when `period_unit` in "Week"
        :param pulumi.Input[str] period_unit: The duration unit that you will buy the resource. It is valid when `instance_charge_type` is 'PrePaid'. Valid value: ["Week", "Month"]. Default to "Month".
        :param pulumi.Input[str] private_ip: Instance private IP address can be specified when you creating new instance. It is valid when `vswitch_id` is specified. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] renewal_status: Whether to renew an ECS instance automatically or not. It is valid when `instance_charge_type` is `PrePaid`. Default to "Normal". Valid values:
               - `AutoRenewal`: Enable auto renewal.
               - `Normal`: Disable auto renewal.
               - `NotRenewal`: No renewal any longer. After you specify this value, Alibaba Cloud stop sending notification of instance expiry, and only gives a brief reminder on the third day before the instance expiry.
        :param pulumi.Input[str] resource_group_id: The Id of resource group which the instance belongs.
        :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] security_enhancement_strategy: The security enhancement strategy.
               - Active: Enable security enhancement strategy, it only works on system images.
               - Deactive: Disable security enhancement strategy, it works on all images.
        :param pulumi.Input[list] security_groups: A list of security group ids to associate with.
        :param pulumi.Input[float] spot_price_limit: The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
        :param pulumi.Input[str] spot_strategy: The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter `instance_charge_type` is 'PostPaid'. Value range:
               - NoSpot: A regular Pay-As-You-Go instance.
               - SpotWithPriceLimit: A price threshold for a spot instance
               - SpotAsPriceGo: A price that is based on the highest Pay-As-You-Go instance
        :param pulumi.Input[str] system_disk_category: Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`. `cloud` only is used to some none I/O optimized instance. Default to `cloud_efficiency`.
        :param pulumi.Input[float] system_disk_size: Size of the system disk, measured in GiB. Value range: [20, 500]. The specified value must be equal to or greater than max{20, Imagesize}. Default value: max{40, ImageSize}. ECS instance's system disk can be reset when replacing system disk. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        :param pulumi.Input[str] user_data: User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance. From version 1.60.0, it can be update in-place. If updated, the instance will reboot to make the change take effect. Note: Not all of changes will take effect and it depends on [cloud-init module type](https://cloudinit.readthedocs.io/en/latest/topics/modules.html).
        :param pulumi.Input[dict] volume_tags: A mapping of tags to assign to the devices created by the instance at launch time.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        :param pulumi.Input[str] vswitch_id: The virtual switch ID to launch in VPC. This parameter must be set unless you can create classic network instances. When it is changed, the instance will reboot to make the change take effect.
        
        The **data_disks** object supports the following:
        
          * `category` (`pulumi.Input[str]`) - The category of the disk:
            - `cloud`: The general cloud disk.
            - `cloud_efficiency`: The efficiency cloud disk.
            - `cloud_ssd`: The SSD cloud disk.
            - `cloud_essd`: The ESSD cloud disk.
            - `ephemeral_ssd`: The local SSD disk.
            Default to `cloud_efficiency`.
            * `encrypted` -(Optional, Bool, ForceNew) Encrypted the data in this disk.
          * `delete_with_instance` (`pulumi.Input[bool]`) - Delete this data disk when the instance is destroyed. It only works on cloud, cloud_efficiency, cloud_essd, cloud_ssd disk. If the category of this data disk was ephemeral_ssd, please don't set this param.
          * `description` (`pulumi.Input[str]`) - The description of the data disk.
          * `encrypted` (`pulumi.Input[bool]`)
          * `name` (`pulumi.Input[str]`) - The name of the data disk.
          * `size` (`pulumi.Input[float]`) - The size of the data disk.
            - cloud：[5, 2000]
            - cloud_efficiency：[20, 32768]
            - cloud_ssd：[20, 32768]
            - cloud_essd：[20, 32768]
            - ephemeral_ssd: [5, 800]
          * `snapshot_id` (`pulumi.Input[str]`) - The snapshot ID used to initialize the data disk. If the size specified by snapshot is greater that the size of the disk, use the size specified by snapshot as the size of the data disk.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/instance.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__['allocate_public_ip'] = allocate_public_ip
            __props__['auto_release_time'] = auto_release_time
            __props__['auto_renew_period'] = auto_renew_period
            __props__['availability_zone'] = availability_zone
            __props__['credit_specification'] = credit_specification
            __props__['data_disks'] = data_disks
            __props__['deletion_protection'] = deletion_protection
            __props__['description'] = description
            __props__['dry_run'] = dry_run
            __props__['force_delete'] = force_delete
            __props__['host_name'] = host_name
            if image_id is None:
                raise TypeError("Missing required property 'image_id'")
            __props__['image_id'] = image_id
            __props__['include_data_disks'] = include_data_disks
            __props__['instance_charge_type'] = instance_charge_type
            __props__['instance_name'] = instance_name
            if instance_type is None:
                raise TypeError("Missing required property 'instance_type'")
            __props__['instance_type'] = instance_type
            __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__['password'] = password
            __props__['period'] = period
            __props__['period_unit'] = period_unit
            __props__['private_ip'] = private_ip
            __props__['renewal_status'] = renewal_status
            __props__['resource_group_id'] = resource_group_id
            __props__['role_name'] = role_name
            __props__['security_enhancement_strategy'] = security_enhancement_strategy
            if security_groups is None:
                raise TypeError("Missing required property 'security_groups'")
            __props__['security_groups'] = security_groups
            __props__['spot_price_limit'] = spot_price_limit
            __props__['spot_strategy'] = spot_strategy
            __props__['subnet_id'] = subnet_id
            __props__['system_disk_category'] = system_disk_category
            __props__['system_disk_size'] = system_disk_size
            __props__['tags'] = tags
            __props__['user_data'] = user_data
            __props__['volume_tags'] = volume_tags
            __props__['vswitch_id'] = vswitch_id
            __props__['public_ip'] = None
            __props__['status'] = None
        super(Instance, __self__).__init__(
            'alicloud:ecs/instance:Instance',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, allocate_public_ip=None, auto_release_time=None, auto_renew_period=None, availability_zone=None, credit_specification=None, data_disks=None, deletion_protection=None, description=None, dry_run=None, force_delete=None, host_name=None, image_id=None, include_data_disks=None, instance_charge_type=None, instance_name=None, instance_type=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, password=None, period=None, period_unit=None, private_ip=None, public_ip=None, renewal_status=None, resource_group_id=None, role_name=None, security_enhancement_strategy=None, security_groups=None, spot_price_limit=None, spot_strategy=None, status=None, subnet_id=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None, volume_tags=None, vswitch_id=None):
        """
        Get an existing Instance 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] allocate_public_ip: It has been deprecated from version "1.7.0". Setting "internet_max_bandwidth_out" larger than 0 can allocate a public ip address for an instance.
        :param pulumi.Input[str] auto_release_time: The automatic release time of the `PostPaid` instance. 
               The time follows the ISO 8601 standard and is in UTC time. Format: yyyy-MM-ddTHH:mm:ssZ. It must be at least half an hour later than the current time and less than 3 years since the current time.
               Set it to null can cancel automatic release attribute and the ECS instance will not be released automatically.
        :param pulumi.Input[float] auto_renew_period: Auto renewal period of an instance, in the unit of month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid value:
               - [1, 2, 3, 6, 12] when `period_unit` in "Month"
               - [1, 2, 3] when `period_unit` in "Week"
        :param pulumi.Input[str] availability_zone: The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
        :param pulumi.Input[str] credit_specification: Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
        :param pulumi.Input[list] data_disks: The list of data disks created with instance.
        :param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
               - true: Enable deletion protection.
               - false: Disable deletion protection.
        :param pulumi.Input[str] description: The description of the data disk.
        :param pulumi.Input[bool] dry_run: Specifies whether to send a dry-run request. Default to false. 
               - true: Only a dry-run request is sent and no instance is created. The system checks whether the required parameters are set, and validates the request format, service permissions, and available ECS instances. If the validation fails, the corresponding error code is returned. If the validation succeeds, the `DryRunOperation` error code is returned.
               - false: A request is sent. If the validation succeeds, the instance is created.
        :param pulumi.Input[bool] force_delete: If it is true, the "PrePaid" instance will be change to "PostPaid" and then deleted forcibly.
               However, because of changing instance charge type has CPU core count quota limitation, so strongly recommand that "Don't modify instance charge type frequentlly in one month".
        :param pulumi.Input[str] host_name: Host name of the ECS, which is a string of at least two characters. “hostname” cannot start or end with “.” or “-“. In addition, two or more consecutive “.” or “-“ symbols are not allowed. On Windows, the host name can contain a maximum of 15 characters, which can be a combination of uppercase/lowercase letters, numerals, and “-“. The host name cannot contain dots (“.”) or contain only numeric characters. When it is changed, the instance will reboot to make the change take effect.
               On other OSs such as Linux, the host name can contain a maximum of 30 characters, which can be segments separated by dots (“.”), where each segment can contain uppercase/lowercase letters, numerals, or “_“. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] image_id: The Image to use for the instance. ECS instance's image can be replaced via changing 'image_id'. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[bool] include_data_disks: Whether to change instance disks charge type when changing instance charge type.
        :param pulumi.Input[str] instance_charge_type: Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
        :param pulumi.Input[str] instance_type: The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] internet_charge_type: Internet charge type of the instance, Valid values are `PayByBandwidth`, `PayByTraffic`. Default is `PayByTraffic`. At present, 'PrePaid' instance cannot change the value to "PayByBandwidth" from "PayByTraffic".
        :param pulumi.Input[float] internet_max_bandwidth_in: Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). Value range: [1, 200]. If this value is not specified, then automatically sets it to 200 Mbps.
        :param pulumi.Input[float] internet_max_bandwidth_out: Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
        :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 an instance. If the `password` is filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[dict] kms_encryption_context: An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance 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. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] password: Password to an instance is a string of 8 to 30 characters. It must contain uppercase/lowercase letters and numerals, but cannot contain special symbols. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[float] period: The duration that you will buy the resource, in month. It is valid when `instance_charge_type` is `PrePaid`. Default to 1. Valid values:
               - [1-9, 12, 24, 36, 48, 60] when `period_unit` in "Month"
               - [1-3] when `period_unit` in "Week"
        :param pulumi.Input[str] period_unit: The duration unit that you will buy the resource. It is valid when `instance_charge_type` is 'PrePaid'. Valid value: ["Week", "Month"]. Default to "Month".
        :param pulumi.Input[str] private_ip: Instance private IP address can be specified when you creating new instance. It is valid when `vswitch_id` is specified. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[str] public_ip: The instance public ip.
        :param pulumi.Input[str] renewal_status: Whether to renew an ECS instance automatically or not. It is valid when `instance_charge_type` is `PrePaid`. Default to "Normal". Valid values:
               - `AutoRenewal`: Enable auto renewal.
               - `Normal`: Disable auto renewal.
               - `NotRenewal`: No renewal any longer. After you specify this value, Alibaba Cloud stop sending notification of instance expiry, and only gives a brief reminder on the third day before the instance expiry.
        :param pulumi.Input[str] resource_group_id: The Id of resource group which the instance belongs.
        :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] security_enhancement_strategy: The security enhancement strategy.
               - Active: Enable security enhancement strategy, it only works on system images.
               - Deactive: Disable security enhancement strategy, it works on all images.
        :param pulumi.Input[list] security_groups: A list of security group ids to associate with.
        :param pulumi.Input[float] spot_price_limit: The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
        :param pulumi.Input[str] spot_strategy: The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter `instance_charge_type` is 'PostPaid'. Value range:
               - NoSpot: A regular Pay-As-You-Go instance.
               - SpotWithPriceLimit: A price threshold for a spot instance
               - SpotAsPriceGo: A price that is based on the highest Pay-As-You-Go instance
        :param pulumi.Input[str] status: The instance status.
        :param pulumi.Input[str] system_disk_category: Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`. `cloud` only is used to some none I/O optimized instance. Default to `cloud_efficiency`.
        :param pulumi.Input[float] system_disk_size: Size of the system disk, measured in GiB. Value range: [20, 500]. The specified value must be equal to or greater than max{20, Imagesize}. Default value: max{40, ImageSize}. ECS instance's system disk can be reset when replacing system disk. When it is changed, the instance will reboot to make the change take effect.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        :param pulumi.Input[str] user_data: User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance. From version 1.60.0, it can be update in-place. If updated, the instance will reboot to make the change take effect. Note: Not all of changes will take effect and it depends on [cloud-init module type](https://cloudinit.readthedocs.io/en/latest/topics/modules.html).
        :param pulumi.Input[dict] volume_tags: A mapping of tags to assign to the devices created by the instance at launch time.
               - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
               - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        :param pulumi.Input[str] vswitch_id: The virtual switch ID to launch in VPC. This parameter must be set unless you can create classic network instances. When it is changed, the instance will reboot to make the change take effect.
        
        The **data_disks** object supports the following:
        
          * `category` (`pulumi.Input[str]`) - The category of the disk:
            - `cloud`: The general cloud disk.
            - `cloud_efficiency`: The efficiency cloud disk.
            - `cloud_ssd`: The SSD cloud disk.
            - `cloud_essd`: The ESSD cloud disk.
            - `ephemeral_ssd`: The local SSD disk.
            Default to `cloud_efficiency`.
            * `encrypted` -(Optional, Bool, ForceNew) Encrypted the data in this disk.
          * `delete_with_instance` (`pulumi.Input[bool]`) - Delete this data disk when the instance is destroyed. It only works on cloud, cloud_efficiency, cloud_essd, cloud_ssd disk. If the category of this data disk was ephemeral_ssd, please don't set this param.
          * `description` (`pulumi.Input[str]`) - The description of the data disk.
          * `encrypted` (`pulumi.Input[bool]`)
          * `name` (`pulumi.Input[str]`) - The name of the data disk.
          * `size` (`pulumi.Input[float]`) - The size of the data disk.
            - cloud：[5, 2000]
            - cloud_efficiency：[20, 32768]
            - cloud_ssd：[20, 32768]
            - cloud_essd：[20, 32768]
            - ephemeral_ssd: [5, 800]
          * `snapshot_id` (`pulumi.Input[str]`) - The snapshot ID used to initialize the data disk. If the size specified by snapshot is greater that the size of the disk, use the size specified by snapshot as the size of the data disk.

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

        __props__ = dict()
        __props__["allocate_public_ip"] = allocate_public_ip
        __props__["auto_release_time"] = auto_release_time
        __props__["auto_renew_period"] = auto_renew_period
        __props__["availability_zone"] = availability_zone
        __props__["credit_specification"] = credit_specification
        __props__["data_disks"] = data_disks
        __props__["deletion_protection"] = deletion_protection
        __props__["description"] = description
        __props__["dry_run"] = dry_run
        __props__["force_delete"] = force_delete
        __props__["host_name"] = host_name
        __props__["image_id"] = image_id
        __props__["include_data_disks"] = include_data_disks
        __props__["instance_charge_type"] = instance_charge_type
        __props__["instance_name"] = instance_name
        __props__["instance_type"] = instance_type
        __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__["password"] = password
        __props__["period"] = period
        __props__["period_unit"] = period_unit
        __props__["private_ip"] = private_ip
        __props__["public_ip"] = public_ip
        __props__["renewal_status"] = renewal_status
        __props__["resource_group_id"] = resource_group_id
        __props__["role_name"] = role_name
        __props__["security_enhancement_strategy"] = security_enhancement_strategy
        __props__["security_groups"] = security_groups
        __props__["spot_price_limit"] = spot_price_limit
        __props__["spot_strategy"] = spot_strategy
        __props__["status"] = status
        __props__["subnet_id"] = subnet_id
        __props__["system_disk_category"] = system_disk_category
        __props__["system_disk_size"] = system_disk_size
        __props__["tags"] = tags
        __props__["user_data"] = user_data
        __props__["volume_tags"] = volume_tags
        __props__["vswitch_id"] = vswitch_id
        return Instance(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

