// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Ecs
{
    /// <summary>
    /// ## Import
    /// 
    /// Instance can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ecs/instance:Instance example i-abc12345678
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ecs/instance:Instance")]
    public partial class Instance : global::Pulumi.CustomResource
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Output("allocatePublicIp")]
        public Output<bool?> AllocatePublicIp { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("autoReleaseTime")]
        public Output<string?> AutoReleaseTime { get; private set; } = null!;

        /// <summary>
        /// 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"
        /// </summary>
        [Output("autoRenewPeriod")]
        public Output<int?> AutoRenewPeriod { get; private set; } = null!;

        /// <summary>
        /// The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
        /// </summary>
        [Output("availabilityZone")]
        public Output<string> AvailabilityZone { get; private set; } = null!;

        /// <summary>
        /// The number of vCPUs.
        /// </summary>
        [Output("cpu")]
        public Output<int> Cpu { get; private set; } = null!;

        /// <summary>
        /// Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
        /// </summary>
        [Output("creditSpecification")]
        public Output<string> CreditSpecification { get; private set; } = null!;

        /// <summary>
        /// The list of data disks created with instance.
        /// </summary>
        [Output("dataDisks")]
        public Output<ImmutableArray<Outputs.InstanceDataDisk>> DataDisks { get; private set; } = null!;

        /// <summary>
        /// The ID of the dedicated host on which to create the instance. If you set the DedicatedHostId parameter, the `spot_strategy` and `spot_price_limit` parameters cannot be set. This is because preemptible instances cannot be created on dedicated hosts.
        /// </summary>
        [Output("dedicatedHostId")]
        public Output<string?> DedicatedHostId { get; private set; } = null!;

        /// <summary>
        /// Whether enable the deletion protection or not. Default value: `false`.
        /// - true: Enable deletion protection.
        /// - false: Disable deletion protection.
        /// </summary>
        [Output("deletionProtection")]
        public Output<bool?> DeletionProtection { get; private set; } = null!;

        /// <summary>
        /// (Optional, Available in 1.149.0+) The group number of the instance in a deployment set when the deployment set is use.
        /// </summary>
        [Output("deploymentSetGroupNo")]
        public Output<string> DeploymentSetGroupNo { get; private set; } = null!;

        /// <summary>
        /// The ID of the deployment set to which to deploy the instance. **NOTE:** From version 1.176.0, instance's deploymentSetId can be removed when 'deployment_set_id' = "".
        /// </summary>
        [Output("deploymentSetId")]
        public Output<string?> DeploymentSetId { get; private set; } = null!;

        /// <summary>
        /// The description of the data disk.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("dryRun")]
        public Output<bool?> DryRun { get; private set; } = null!;

        /// <summary>
        /// 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".
        /// </summary>
        [Output("forceDelete")]
        public Output<bool?> ForceDelete { get; private set; } = null!;

        /// <summary>
        /// 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 64 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.
        /// </summary>
        [Output("hostName")]
        public Output<string> HostName { get; private set; } = null!;

        /// <summary>
        /// The ID of the Elastic High Performance Computing (E-HPC) cluster to which to assign the instance.
        /// </summary>
        [Output("hpcClusterId")]
        public Output<string?> HpcClusterId { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable the access channel for instance metadata. Valid values: `enabled`, `disabled`. Default value: `enabled`.
        /// </summary>
        [Output("httpEndpoint")]
        public Output<string> HttpEndpoint { get; private set; } = null!;

        /// <summary>
        /// The HTTP PUT response hop limit for accessing instance metadata. Valid values: 1 to 64. Default value: 1.
        /// </summary>
        [Output("httpPutResponseHopLimit")]
        public Output<int> HttpPutResponseHopLimit { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to forcefully use the security-enhanced mode (IMDSv2) to access instance metadata. Default value: optional. Valid values:
        /// - optional: does not forcefully use the security-enhanced mode (IMDSv2).
        /// - required: forcefully uses the security-enhanced mode (IMDSv2). After you set this parameter to required, you cannot access instance metadata in normal mode.
        /// </summary>
        [Output("httpTokens")]
        public Output<string> HttpTokens { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("imageId")]
        public Output<string> ImageId { get; private set; } = null!;

        /// <summary>
        /// Whether to change instance disks charge type when changing instance charge type.
        /// </summary>
        [Output("includeDataDisks")]
        public Output<bool?> IncludeDataDisks { get; private set; } = null!;

        /// <summary>
        /// Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
        /// </summary>
        [Output("instanceChargeType")]
        public Output<string?> InstanceChargeType { get; private set; } = null!;

        [Output("instanceName")]
        public Output<string?> InstanceName { get; private set; } = null!;

        /// <summary>
        /// The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
        /// </summary>
        [Output("instanceType")]
        public Output<string> InstanceType { get; private set; } = null!;

        /// <summary>
        /// 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".
        /// </summary>
        [Output("internetChargeType")]
        public Output<string?> InternetChargeType { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("internetMaxBandwidthIn")]
        public Output<int> InternetMaxBandwidthIn { get; private set; } = null!;

        /// <summary>
        /// Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
        /// </summary>
        [Output("internetMaxBandwidthOut")]
        public Output<int?> InternetMaxBandwidthOut { get; private set; } = null!;

        /// <summary>
        /// It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
        /// </summary>
        [Output("ioOptimized")]
        public Output<string?> IoOptimized { get; private set; } = null!;

        /// <summary>
        /// The number of IPv6 addresses to randomly generate for the primary ENI. Valid values: 1 to 10. **NOTE:** You cannot specify both the `ipv6_addresses` and `ipv6_address_count` parameters.
        /// </summary>
        [Output("ipv6AddressCount")]
        public Output<int> Ipv6AddressCount { get; private set; } = null!;

        /// <summary>
        /// A list of IPv6 address to be assigned to the primary ENI. Support up to 10.
        /// </summary>
        [Output("ipv6Addresses")]
        public Output<ImmutableArray<string>> Ipv6Addresses { get; private set; } = null!;

        /// <summary>
        /// Whether to use outdated instance type. Default to false.
        /// </summary>
        [Output("isOutdated")]
        public Output<bool?> IsOutdated { get; private set; } = null!;

        /// <summary>
        /// The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
        /// </summary>
        [Output("keyName")]
        public Output<string> KeyName { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("kmsEncryptedPassword")]
        public Output<string?> KmsEncryptedPassword { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("kmsEncryptionContext")]
        public Output<ImmutableDictionary<string, object>?> KmsEncryptionContext { get; private set; } = null!;

        /// <summary>
        /// The maintenance action. Valid values: `Stop`, `AutoRecover` and `AutoRedeploy`.
        /// </summary>
        [Output("maintenanceAction")]
        public Output<string> MaintenanceAction { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to send an event notification before instance shutdown. Valid values: `true`, `false`. Default value: `false`.
        /// </summary>
        [Output("maintenanceNotify")]
        public Output<bool?> MaintenanceNotify { get; private set; } = null!;

        /// <summary>
        /// The time of maintenance. See the following `Block maintenance_time`.
        /// </summary>
        [Output("maintenanceTime")]
        public Output<Outputs.InstanceMaintenanceTime?> MaintenanceTime { get; private set; } = null!;

        /// <summary>
        /// The memory size of the instance. Unit: MiB.
        /// </summary>
        [Output("memory")]
        public Output<int> Memory { get; private set; } = null!;

        /// <summary>
        /// The operation type. It is valid when `instance_charge_type` is `PrePaid`. Default value: `upgrade`. Valid values: `upgrade`, `downgrade`. **NOTE:**  When the new instance type specified by the `instance_type` parameter has lower specifications than the current instance type, you must set `operator_type` to `downgrade`.
        /// </summary>
        [Output("operatorType")]
        public Output<string?> OperatorType { get; private set; } = null!;

        /// <summary>
        /// The name of the operating system of the instance.
        /// </summary>
        [Output("osName")]
        public Output<string> OsName { get; private set; } = null!;

        /// <summary>
        /// The type of the operating system of the instance.
        /// </summary>
        [Output("osType")]
        public Output<string> OsType { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        [Output("period")]
        public Output<int?> Period { get; private set; } = null!;

        /// <summary>
        /// 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".
        /// </summary>
        [Output("periodUnit")]
        public Output<string?> PeriodUnit { get; private set; } = null!;

        /// <summary>
        /// The primary private IP address of the ENI.
        /// </summary>
        [Output("primaryIpAddress")]
        public Output<string> PrimaryIpAddress { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("privateIp")]
        public Output<string> PrivateIp { get; private set; } = null!;

        /// <summary>
        /// The instance public ip.
        /// </summary>
        [Output("publicIp")]
        public Output<string> PublicIp { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("renewalStatus")]
        public Output<string?> RenewalStatus { get; private set; } = null!;

        /// <summary>
        /// The Id of resource group which the instance belongs.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string?> ResourceGroupId { get; private set; } = null!;

        /// <summary>
        /// Instance RAM role name. The name is provided and maintained by RAM. You can use `alicloud.ram.Role` to create a new one.
        /// </summary>
        [Output("roleName")]
        public Output<string> RoleName { get; private set; } = null!;

        /// <summary>
        /// The number of private IP addresses to be automatically assigned from within the CIDR block of the vswitch. **NOTE:** To assign secondary private IP addresses, you must specify `secondary_private_ips` or `secondary_private_ip_address_count` but not both.
        /// </summary>
        [Output("secondaryPrivateIpAddressCount")]
        public Output<int> SecondaryPrivateIpAddressCount { get; private set; } = null!;

        /// <summary>
        /// A list of Secondary private IP addresses which is selected from within the CIDR block of the VSwitch.
        /// </summary>
        [Output("secondaryPrivateIps")]
        public Output<ImmutableArray<string>> SecondaryPrivateIps { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("securityEnhancementStrategy")]
        public Output<string?> SecurityEnhancementStrategy { get; private set; } = null!;

        /// <summary>
        /// A list of security group ids to associate with.
        /// </summary>
        [Output("securityGroups")]
        public Output<ImmutableArray<string>> SecurityGroups { get; private set; } = null!;

        /// <summary>
        /// The retention time of the preemptive instance in hours. Valid values: `0`, `1`, `2`, `3`, `4`, `5`, `6`. Retention duration 2~6 is under invitation test, please submit a work order if you need to open. If the value is `0`, the mode is no protection period. Default value is `1`.
        /// </summary>
        [Output("spotDuration")]
        public Output<int> SpotDuration { get; private set; } = null!;

        /// <summary>
        /// The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
        /// </summary>
        [Output("spotPriceLimit")]
        public Output<double?> SpotPriceLimit { get; private set; } = null!;

        /// <summary>
        /// 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
        /// </summary>
        [Output("spotStrategy")]
        public Output<string> SpotStrategy { get; private set; } = null!;

        /// <summary>
        /// The instance status. Valid values: ["Running", "Stopped"]. You can control the instance start and stop through this parameter. Default to `Running`.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// The stop mode of the pay-as-you-go instance. Valid values: `StopCharging`,`KeepCharging`, `Not-applicable`. Default value: If the prerequisites required for enabling the economical mode are met, and you have enabled this mode in the ECS console, the default value is `StopCharging`. For more information, see "Enable the economical mode" in [Economical mode](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/economical-mode). Otherwise, the default value is `KeepCharging`. **Note:** `Not-applicable`: Economical mode is not applicable to the instance.`
        /// * `KeepCharging`: standard mode. Billing of the instance continues after the instance is stopped, and resources are retained for the instance.
        /// * `StopCharging`: economical mode. Billing of some resources of the instance stops after the instance is stopped. When the instance is stopped, its resources such as vCPUs, memory, and public IP address are released. You may be unable to restart the instance if some types of resources are out of stock in the current region.
        /// </summary>
        [Output("stoppedMode")]
        public Output<string> StoppedMode { get; private set; } = null!;

        [Output("subnetId")]
        public Output<string> SubnetId { get; private set; } = null!;

        /// <summary>
        /// The ID of the automatic snapshot policy applied to the system disk.
        /// </summary>
        [Output("systemDiskAutoSnapshotPolicyId")]
        public Output<string?> SystemDiskAutoSnapshotPolicyId { get; private set; } = null!;

        /// <summary>
        /// Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`, `cloud_auto`. only is used to some none I/O optimized instance. Default to `cloud_efficiency`. Valid values `cloud_auto` Available in 1.184.0+.
        /// </summary>
        [Output("systemDiskCategory")]
        public Output<string?> SystemDiskCategory { get; private set; } = null!;

        /// <summary>
        /// The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
        /// </summary>
        [Output("systemDiskDescription")]
        public Output<string?> SystemDiskDescription { get; private set; } = null!;

        /// <summary>
        /// The algorithm to be used to encrypt the system disk. Valid values are `aes-256`, `sm4-128`. Default value is `aes-256`.
        /// </summary>
        [Output("systemDiskEncryptAlgorithm")]
        public Output<string?> SystemDiskEncryptAlgorithm { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to encrypt the system disk. Valid values: `true`,`false`. Default value: `false`.
        /// - `true`: encrypts the system disk.
        /// - `false`: does not encrypt the system disk.
        /// </summary>
        [Output("systemDiskEncrypted")]
        public Output<bool?> SystemDiskEncrypted { get; private set; } = null!;

        /// <summary>
        /// The ID of the Key Management Service (KMS) key to be used for the system disk.
        /// </summary>
        [Output("systemDiskKmsKeyId")]
        public Output<string?> SystemDiskKmsKeyId { get; private set; } = null!;

        /// <summary>
        /// The name of the system disk. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
        /// </summary>
        [Output("systemDiskName")]
        public Output<string?> SystemDiskName { get; private set; } = null!;

        /// <summary>
        /// The performance level of the ESSD used as the system disk, Valid values: `PL0`, `PL1`, `PL2`, `PL3`, Default to `PL1`;For more information about ESSD, See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/122389.htm).
        /// </summary>
        [Output("systemDiskPerformanceLevel")]
        public Output<string> SystemDiskPerformanceLevel { get; private set; } = null!;

        /// <summary>
        /// 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}.
        /// </summary>
        [Output("systemDiskSize")]
        public Output<int?> SystemDiskSize { get; private set; } = null!;

        /// <summary>
        /// The ID of the dedicated block storage cluster. If you want to use disks in a dedicated block storage cluster as system disks when you create instances, you must specify this parameter. For more information about dedicated block storage clusters, see [What is Dedicated Block Storage Cluster?](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/dedicated-block-storage-clusters-overview).
        /// </summary>
        [Output("systemDiskStorageClusterId")]
        public Output<string?> SystemDiskStorageClusterId { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, string>?> Tags { get; private set; } = null!;

        /// <summary>
        /// User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance.
        /// It supports to setting a base64-encoded value, and it is the recommended usage.
        /// 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).
        /// </summary>
        [Output("userData")]
        public Output<string?> UserData { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("volumeTags")]
        public Output<ImmutableDictionary<string, object>> VolumeTags { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("vswitchId")]
        public Output<string?> VswitchId { get; private set; } = null!;


        /// <summary>
        /// Create a Instance resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Instance(string name, InstanceArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ecs/instance:Instance", name, args ?? new InstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Instance(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:ecs/instance:Instance", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Instance resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Instance Get(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
        {
            return new Instance(name, id, state, options);
        }
    }

    public sealed class InstanceArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Input("allocatePublicIp")]
        public Input<bool>? AllocatePublicIp { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("autoReleaseTime")]
        public Input<string>? AutoReleaseTime { get; set; }

        /// <summary>
        /// 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"
        /// </summary>
        [Input("autoRenewPeriod")]
        public Input<int>? AutoRenewPeriod { get; set; }

        /// <summary>
        /// The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
        /// </summary>
        [Input("creditSpecification")]
        public Input<string>? CreditSpecification { get; set; }

        [Input("dataDisks")]
        private InputList<Inputs.InstanceDataDiskArgs>? _dataDisks;

        /// <summary>
        /// The list of data disks created with instance.
        /// </summary>
        public InputList<Inputs.InstanceDataDiskArgs> DataDisks
        {
            get => _dataDisks ?? (_dataDisks = new InputList<Inputs.InstanceDataDiskArgs>());
            set => _dataDisks = value;
        }

        /// <summary>
        /// The ID of the dedicated host on which to create the instance. If you set the DedicatedHostId parameter, the `spot_strategy` and `spot_price_limit` parameters cannot be set. This is because preemptible instances cannot be created on dedicated hosts.
        /// </summary>
        [Input("dedicatedHostId")]
        public Input<string>? DedicatedHostId { get; set; }

        /// <summary>
        /// Whether enable the deletion protection or not. Default value: `false`.
        /// - true: Enable deletion protection.
        /// - false: Disable deletion protection.
        /// </summary>
        [Input("deletionProtection")]
        public Input<bool>? DeletionProtection { get; set; }

        /// <summary>
        /// The ID of the deployment set to which to deploy the instance. **NOTE:** From version 1.176.0, instance's deploymentSetId can be removed when 'deployment_set_id' = "".
        /// </summary>
        [Input("deploymentSetId")]
        public Input<string>? DeploymentSetId { get; set; }

        /// <summary>
        /// The description of the data disk.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("dryRun")]
        public Input<bool>? DryRun { get; set; }

        /// <summary>
        /// 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".
        /// </summary>
        [Input("forceDelete")]
        public Input<bool>? ForceDelete { get; set; }

        /// <summary>
        /// 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 64 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.
        /// </summary>
        [Input("hostName")]
        public Input<string>? HostName { get; set; }

        /// <summary>
        /// The ID of the Elastic High Performance Computing (E-HPC) cluster to which to assign the instance.
        /// </summary>
        [Input("hpcClusterId")]
        public Input<string>? HpcClusterId { get; set; }

        /// <summary>
        /// Specifies whether to enable the access channel for instance metadata. Valid values: `enabled`, `disabled`. Default value: `enabled`.
        /// </summary>
        [Input("httpEndpoint")]
        public Input<string>? HttpEndpoint { get; set; }

        /// <summary>
        /// The HTTP PUT response hop limit for accessing instance metadata. Valid values: 1 to 64. Default value: 1.
        /// </summary>
        [Input("httpPutResponseHopLimit")]
        public Input<int>? HttpPutResponseHopLimit { get; set; }

        /// <summary>
        /// Specifies whether to forcefully use the security-enhanced mode (IMDSv2) to access instance metadata. Default value: optional. Valid values:
        /// - optional: does not forcefully use the security-enhanced mode (IMDSv2).
        /// - required: forcefully uses the security-enhanced mode (IMDSv2). After you set this parameter to required, you cannot access instance metadata in normal mode.
        /// </summary>
        [Input("httpTokens")]
        public Input<string>? HttpTokens { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("imageId", required: true)]
        public Input<string> ImageId { get; set; } = null!;

        /// <summary>
        /// Whether to change instance disks charge type when changing instance charge type.
        /// </summary>
        [Input("includeDataDisks")]
        public Input<bool>? IncludeDataDisks { get; set; }

        /// <summary>
        /// Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
        /// </summary>
        [Input("instanceType", required: true)]
        public Input<string> InstanceType { get; set; } = null!;

        /// <summary>
        /// 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".
        /// </summary>
        [Input("internetChargeType")]
        public Input<string>? InternetChargeType { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("internetMaxBandwidthIn")]
        public Input<int>? InternetMaxBandwidthIn { get; set; }

        /// <summary>
        /// Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
        /// </summary>
        [Input("internetMaxBandwidthOut")]
        public Input<int>? InternetMaxBandwidthOut { get; set; }

        /// <summary>
        /// It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
        /// </summary>
        [Input("ioOptimized")]
        public Input<string>? IoOptimized { get; set; }

        /// <summary>
        /// The number of IPv6 addresses to randomly generate for the primary ENI. Valid values: 1 to 10. **NOTE:** You cannot specify both the `ipv6_addresses` and `ipv6_address_count` parameters.
        /// </summary>
        [Input("ipv6AddressCount")]
        public Input<int>? Ipv6AddressCount { get; set; }

        [Input("ipv6Addresses")]
        private InputList<string>? _ipv6Addresses;

        /// <summary>
        /// A list of IPv6 address to be assigned to the primary ENI. Support up to 10.
        /// </summary>
        public InputList<string> Ipv6Addresses
        {
            get => _ipv6Addresses ?? (_ipv6Addresses = new InputList<string>());
            set => _ipv6Addresses = value;
        }

        /// <summary>
        /// Whether to use outdated instance type. Default to false.
        /// </summary>
        [Input("isOutdated")]
        public Input<bool>? IsOutdated { get; set; }

        /// <summary>
        /// The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
        /// </summary>
        [Input("keyName")]
        public Input<string>? KeyName { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("kmsEncryptedPassword")]
        public Input<string>? KmsEncryptedPassword { get; set; }

        [Input("kmsEncryptionContext")]
        private InputMap<object>? _kmsEncryptionContext;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<object> KmsEncryptionContext
        {
            get => _kmsEncryptionContext ?? (_kmsEncryptionContext = new InputMap<object>());
            set => _kmsEncryptionContext = value;
        }

        /// <summary>
        /// The maintenance action. Valid values: `Stop`, `AutoRecover` and `AutoRedeploy`.
        /// </summary>
        [Input("maintenanceAction")]
        public Input<string>? MaintenanceAction { get; set; }

        /// <summary>
        /// Specifies whether to send an event notification before instance shutdown. Valid values: `true`, `false`. Default value: `false`.
        /// </summary>
        [Input("maintenanceNotify")]
        public Input<bool>? MaintenanceNotify { get; set; }

        /// <summary>
        /// The time of maintenance. See the following `Block maintenance_time`.
        /// </summary>
        [Input("maintenanceTime")]
        public Input<Inputs.InstanceMaintenanceTimeArgs>? MaintenanceTime { get; set; }

        /// <summary>
        /// The operation type. It is valid when `instance_charge_type` is `PrePaid`. Default value: `upgrade`. Valid values: `upgrade`, `downgrade`. **NOTE:**  When the new instance type specified by the `instance_type` parameter has lower specifications than the current instance type, you must set `operator_type` to `downgrade`.
        /// </summary>
        [Input("operatorType")]
        public Input<string>? OperatorType { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// 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".
        /// </summary>
        [Input("periodUnit")]
        public Input<string>? PeriodUnit { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("privateIp")]
        public Input<string>? PrivateIp { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("renewalStatus")]
        public Input<string>? RenewalStatus { get; set; }

        /// <summary>
        /// The Id of resource group which the instance belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// Instance RAM role name. The name is provided and maintained by RAM. You can use `alicloud.ram.Role` to create a new one.
        /// </summary>
        [Input("roleName")]
        public Input<string>? RoleName { get; set; }

        /// <summary>
        /// The number of private IP addresses to be automatically assigned from within the CIDR block of the vswitch. **NOTE:** To assign secondary private IP addresses, you must specify `secondary_private_ips` or `secondary_private_ip_address_count` but not both.
        /// </summary>
        [Input("secondaryPrivateIpAddressCount")]
        public Input<int>? SecondaryPrivateIpAddressCount { get; set; }

        [Input("secondaryPrivateIps")]
        private InputList<string>? _secondaryPrivateIps;

        /// <summary>
        /// A list of Secondary private IP addresses which is selected from within the CIDR block of the VSwitch.
        /// </summary>
        public InputList<string> SecondaryPrivateIps
        {
            get => _secondaryPrivateIps ?? (_secondaryPrivateIps = new InputList<string>());
            set => _secondaryPrivateIps = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("securityEnhancementStrategy")]
        public Input<string>? SecurityEnhancementStrategy { get; set; }

        [Input("securityGroups", required: true)]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// A list of security group ids to associate with.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// The retention time of the preemptive instance in hours. Valid values: `0`, `1`, `2`, `3`, `4`, `5`, `6`. Retention duration 2~6 is under invitation test, please submit a work order if you need to open. If the value is `0`, the mode is no protection period. Default value is `1`.
        /// </summary>
        [Input("spotDuration")]
        public Input<int>? SpotDuration { get; set; }

        /// <summary>
        /// The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
        /// </summary>
        [Input("spotPriceLimit")]
        public Input<double>? SpotPriceLimit { get; set; }

        /// <summary>
        /// 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
        /// </summary>
        [Input("spotStrategy")]
        public Input<string>? SpotStrategy { get; set; }

        /// <summary>
        /// The instance status. Valid values: ["Running", "Stopped"]. You can control the instance start and stop through this parameter. Default to `Running`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// The stop mode of the pay-as-you-go instance. Valid values: `StopCharging`,`KeepCharging`, `Not-applicable`. Default value: If the prerequisites required for enabling the economical mode are met, and you have enabled this mode in the ECS console, the default value is `StopCharging`. For more information, see "Enable the economical mode" in [Economical mode](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/economical-mode). Otherwise, the default value is `KeepCharging`. **Note:** `Not-applicable`: Economical mode is not applicable to the instance.`
        /// * `KeepCharging`: standard mode. Billing of the instance continues after the instance is stopped, and resources are retained for the instance.
        /// * `StopCharging`: economical mode. Billing of some resources of the instance stops after the instance is stopped. When the instance is stopped, its resources such as vCPUs, memory, and public IP address are released. You may be unable to restart the instance if some types of resources are out of stock in the current region.
        /// </summary>
        [Input("stoppedMode")]
        public Input<string>? StoppedMode { get; set; }

        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

        /// <summary>
        /// The ID of the automatic snapshot policy applied to the system disk.
        /// </summary>
        [Input("systemDiskAutoSnapshotPolicyId")]
        public Input<string>? SystemDiskAutoSnapshotPolicyId { get; set; }

        /// <summary>
        /// Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`, `cloud_auto`. only is used to some none I/O optimized instance. Default to `cloud_efficiency`. Valid values `cloud_auto` Available in 1.184.0+.
        /// </summary>
        [Input("systemDiskCategory")]
        public Input<string>? SystemDiskCategory { get; set; }

        /// <summary>
        /// The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
        /// </summary>
        [Input("systemDiskDescription")]
        public Input<string>? SystemDiskDescription { get; set; }

        /// <summary>
        /// The algorithm to be used to encrypt the system disk. Valid values are `aes-256`, `sm4-128`. Default value is `aes-256`.
        /// </summary>
        [Input("systemDiskEncryptAlgorithm")]
        public Input<string>? SystemDiskEncryptAlgorithm { get; set; }

        /// <summary>
        /// Specifies whether to encrypt the system disk. Valid values: `true`,`false`. Default value: `false`.
        /// - `true`: encrypts the system disk.
        /// - `false`: does not encrypt the system disk.
        /// </summary>
        [Input("systemDiskEncrypted")]
        public Input<bool>? SystemDiskEncrypted { get; set; }

        /// <summary>
        /// The ID of the Key Management Service (KMS) key to be used for the system disk.
        /// </summary>
        [Input("systemDiskKmsKeyId")]
        public Input<string>? SystemDiskKmsKeyId { get; set; }

        /// <summary>
        /// The name of the system disk. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
        /// </summary>
        [Input("systemDiskName")]
        public Input<string>? SystemDiskName { get; set; }

        /// <summary>
        /// The performance level of the ESSD used as the system disk, Valid values: `PL0`, `PL1`, `PL2`, `PL3`, Default to `PL1`;For more information about ESSD, See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/122389.htm).
        /// </summary>
        [Input("systemDiskPerformanceLevel")]
        public Input<string>? SystemDiskPerformanceLevel { get; set; }

        /// <summary>
        /// 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}.
        /// </summary>
        [Input("systemDiskSize")]
        public Input<int>? SystemDiskSize { get; set; }

        /// <summary>
        /// The ID of the dedicated block storage cluster. If you want to use disks in a dedicated block storage cluster as system disks when you create instances, you must specify this parameter. For more information about dedicated block storage clusters, see [What is Dedicated Block Storage Cluster?](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/dedicated-block-storage-clusters-overview).
        /// </summary>
        [Input("systemDiskStorageClusterId")]
        public Input<string>? SystemDiskStorageClusterId { get; set; }

        [Input("tags")]
        private InputMap<string>? _tags;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<string> Tags
        {
            get => _tags ?? (_tags = new InputMap<string>());
            set => _tags = value;
        }

        /// <summary>
        /// User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance.
        /// It supports to setting a base64-encoded value, and it is the recommended usage.
        /// 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).
        /// </summary>
        [Input("userData")]
        public Input<string>? UserData { get; set; }

        [Input("volumeTags")]
        private InputMap<object>? _volumeTags;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<object> VolumeTags
        {
            get => _volumeTags ?? (_volumeTags = new InputMap<object>());
            set => _volumeTags = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        public InstanceArgs()
        {
        }
        public static new InstanceArgs Empty => new InstanceArgs();
    }

    public sealed class InstanceState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Input("allocatePublicIp")]
        public Input<bool>? AllocatePublicIp { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("autoReleaseTime")]
        public Input<string>? AutoReleaseTime { get; set; }

        /// <summary>
        /// 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"
        /// </summary>
        [Input("autoRenewPeriod")]
        public Input<int>? AutoRenewPeriod { get; set; }

        /// <summary>
        /// The Zone to start the instance in. It is ignored and will be computed when set `vswitch_id`.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// The number of vCPUs.
        /// </summary>
        [Input("cpu")]
        public Input<int>? Cpu { get; set; }

        /// <summary>
        /// Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.
        /// </summary>
        [Input("creditSpecification")]
        public Input<string>? CreditSpecification { get; set; }

        [Input("dataDisks")]
        private InputList<Inputs.InstanceDataDiskGetArgs>? _dataDisks;

        /// <summary>
        /// The list of data disks created with instance.
        /// </summary>
        public InputList<Inputs.InstanceDataDiskGetArgs> DataDisks
        {
            get => _dataDisks ?? (_dataDisks = new InputList<Inputs.InstanceDataDiskGetArgs>());
            set => _dataDisks = value;
        }

        /// <summary>
        /// The ID of the dedicated host on which to create the instance. If you set the DedicatedHostId parameter, the `spot_strategy` and `spot_price_limit` parameters cannot be set. This is because preemptible instances cannot be created on dedicated hosts.
        /// </summary>
        [Input("dedicatedHostId")]
        public Input<string>? DedicatedHostId { get; set; }

        /// <summary>
        /// Whether enable the deletion protection or not. Default value: `false`.
        /// - true: Enable deletion protection.
        /// - false: Disable deletion protection.
        /// </summary>
        [Input("deletionProtection")]
        public Input<bool>? DeletionProtection { get; set; }

        /// <summary>
        /// (Optional, Available in 1.149.0+) The group number of the instance in a deployment set when the deployment set is use.
        /// </summary>
        [Input("deploymentSetGroupNo")]
        public Input<string>? DeploymentSetGroupNo { get; set; }

        /// <summary>
        /// The ID of the deployment set to which to deploy the instance. **NOTE:** From version 1.176.0, instance's deploymentSetId can be removed when 'deployment_set_id' = "".
        /// </summary>
        [Input("deploymentSetId")]
        public Input<string>? DeploymentSetId { get; set; }

        /// <summary>
        /// The description of the data disk.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("dryRun")]
        public Input<bool>? DryRun { get; set; }

        /// <summary>
        /// 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".
        /// </summary>
        [Input("forceDelete")]
        public Input<bool>? ForceDelete { get; set; }

        /// <summary>
        /// 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 64 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.
        /// </summary>
        [Input("hostName")]
        public Input<string>? HostName { get; set; }

        /// <summary>
        /// The ID of the Elastic High Performance Computing (E-HPC) cluster to which to assign the instance.
        /// </summary>
        [Input("hpcClusterId")]
        public Input<string>? HpcClusterId { get; set; }

        /// <summary>
        /// Specifies whether to enable the access channel for instance metadata. Valid values: `enabled`, `disabled`. Default value: `enabled`.
        /// </summary>
        [Input("httpEndpoint")]
        public Input<string>? HttpEndpoint { get; set; }

        /// <summary>
        /// The HTTP PUT response hop limit for accessing instance metadata. Valid values: 1 to 64. Default value: 1.
        /// </summary>
        [Input("httpPutResponseHopLimit")]
        public Input<int>? HttpPutResponseHopLimit { get; set; }

        /// <summary>
        /// Specifies whether to forcefully use the security-enhanced mode (IMDSv2) to access instance metadata. Default value: optional. Valid values:
        /// - optional: does not forcefully use the security-enhanced mode (IMDSv2).
        /// - required: forcefully uses the security-enhanced mode (IMDSv2). After you set this parameter to required, you cannot access instance metadata in normal mode.
        /// </summary>
        [Input("httpTokens")]
        public Input<string>? HttpTokens { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("imageId")]
        public Input<string>? ImageId { get; set; }

        /// <summary>
        /// Whether to change instance disks charge type when changing instance charge type.
        /// </summary>
        [Input("includeDataDisks")]
        public Input<bool>? IncludeDataDisks { get; set; }

        /// <summary>
        /// Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// 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".
        /// </summary>
        [Input("internetChargeType")]
        public Input<string>? InternetChargeType { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("internetMaxBandwidthIn")]
        public Input<int>? InternetMaxBandwidthIn { get; set; }

        /// <summary>
        /// Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100]. Default to 0 Mbps.
        /// </summary>
        [Input("internetMaxBandwidthOut")]
        public Input<int>? InternetMaxBandwidthOut { get; set; }

        /// <summary>
        /// It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
        /// </summary>
        [Input("ioOptimized")]
        public Input<string>? IoOptimized { get; set; }

        /// <summary>
        /// The number of IPv6 addresses to randomly generate for the primary ENI. Valid values: 1 to 10. **NOTE:** You cannot specify both the `ipv6_addresses` and `ipv6_address_count` parameters.
        /// </summary>
        [Input("ipv6AddressCount")]
        public Input<int>? Ipv6AddressCount { get; set; }

        [Input("ipv6Addresses")]
        private InputList<string>? _ipv6Addresses;

        /// <summary>
        /// A list of IPv6 address to be assigned to the primary ENI. Support up to 10.
        /// </summary>
        public InputList<string> Ipv6Addresses
        {
            get => _ipv6Addresses ?? (_ipv6Addresses = new InputList<string>());
            set => _ipv6Addresses = value;
        }

        /// <summary>
        /// Whether to use outdated instance type. Default to false.
        /// </summary>
        [Input("isOutdated")]
        public Input<bool>? IsOutdated { get; set; }

        /// <summary>
        /// The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
        /// </summary>
        [Input("keyName")]
        public Input<string>? KeyName { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("kmsEncryptedPassword")]
        public Input<string>? KmsEncryptedPassword { get; set; }

        [Input("kmsEncryptionContext")]
        private InputMap<object>? _kmsEncryptionContext;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<object> KmsEncryptionContext
        {
            get => _kmsEncryptionContext ?? (_kmsEncryptionContext = new InputMap<object>());
            set => _kmsEncryptionContext = value;
        }

        /// <summary>
        /// The maintenance action. Valid values: `Stop`, `AutoRecover` and `AutoRedeploy`.
        /// </summary>
        [Input("maintenanceAction")]
        public Input<string>? MaintenanceAction { get; set; }

        /// <summary>
        /// Specifies whether to send an event notification before instance shutdown. Valid values: `true`, `false`. Default value: `false`.
        /// </summary>
        [Input("maintenanceNotify")]
        public Input<bool>? MaintenanceNotify { get; set; }

        /// <summary>
        /// The time of maintenance. See the following `Block maintenance_time`.
        /// </summary>
        [Input("maintenanceTime")]
        public Input<Inputs.InstanceMaintenanceTimeGetArgs>? MaintenanceTime { get; set; }

        /// <summary>
        /// The memory size of the instance. Unit: MiB.
        /// </summary>
        [Input("memory")]
        public Input<int>? Memory { get; set; }

        /// <summary>
        /// The operation type. It is valid when `instance_charge_type` is `PrePaid`. Default value: `upgrade`. Valid values: `upgrade`, `downgrade`. **NOTE:**  When the new instance type specified by the `instance_type` parameter has lower specifications than the current instance type, you must set `operator_type` to `downgrade`.
        /// </summary>
        [Input("operatorType")]
        public Input<string>? OperatorType { get; set; }

        /// <summary>
        /// The name of the operating system of the instance.
        /// </summary>
        [Input("osName")]
        public Input<string>? OsName { get; set; }

        /// <summary>
        /// The type of the operating system of the instance.
        /// </summary>
        [Input("osType")]
        public Input<string>? OsType { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// 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".
        /// </summary>
        [Input("periodUnit")]
        public Input<string>? PeriodUnit { get; set; }

        /// <summary>
        /// The primary private IP address of the ENI.
        /// </summary>
        [Input("primaryIpAddress")]
        public Input<string>? PrimaryIpAddress { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("privateIp")]
        public Input<string>? PrivateIp { get; set; }

        /// <summary>
        /// The instance public ip.
        /// </summary>
        [Input("publicIp")]
        public Input<string>? PublicIp { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("renewalStatus")]
        public Input<string>? RenewalStatus { get; set; }

        /// <summary>
        /// The Id of resource group which the instance belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// Instance RAM role name. The name is provided and maintained by RAM. You can use `alicloud.ram.Role` to create a new one.
        /// </summary>
        [Input("roleName")]
        public Input<string>? RoleName { get; set; }

        /// <summary>
        /// The number of private IP addresses to be automatically assigned from within the CIDR block of the vswitch. **NOTE:** To assign secondary private IP addresses, you must specify `secondary_private_ips` or `secondary_private_ip_address_count` but not both.
        /// </summary>
        [Input("secondaryPrivateIpAddressCount")]
        public Input<int>? SecondaryPrivateIpAddressCount { get; set; }

        [Input("secondaryPrivateIps")]
        private InputList<string>? _secondaryPrivateIps;

        /// <summary>
        /// A list of Secondary private IP addresses which is selected from within the CIDR block of the VSwitch.
        /// </summary>
        public InputList<string> SecondaryPrivateIps
        {
            get => _secondaryPrivateIps ?? (_secondaryPrivateIps = new InputList<string>());
            set => _secondaryPrivateIps = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("securityEnhancementStrategy")]
        public Input<string>? SecurityEnhancementStrategy { get; set; }

        [Input("securityGroups")]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// A list of security group ids to associate with.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// The retention time of the preemptive instance in hours. Valid values: `0`, `1`, `2`, `3`, `4`, `5`, `6`. Retention duration 2~6 is under invitation test, please submit a work order if you need to open. If the value is `0`, the mode is no protection period. Default value is `1`.
        /// </summary>
        [Input("spotDuration")]
        public Input<int>? SpotDuration { get; set; }

        /// <summary>
        /// The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.
        /// </summary>
        [Input("spotPriceLimit")]
        public Input<double>? SpotPriceLimit { get; set; }

        /// <summary>
        /// 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
        /// </summary>
        [Input("spotStrategy")]
        public Input<string>? SpotStrategy { get; set; }

        /// <summary>
        /// The instance status. Valid values: ["Running", "Stopped"]. You can control the instance start and stop through this parameter. Default to `Running`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// The stop mode of the pay-as-you-go instance. Valid values: `StopCharging`,`KeepCharging`, `Not-applicable`. Default value: If the prerequisites required for enabling the economical mode are met, and you have enabled this mode in the ECS console, the default value is `StopCharging`. For more information, see "Enable the economical mode" in [Economical mode](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/economical-mode). Otherwise, the default value is `KeepCharging`. **Note:** `Not-applicable`: Economical mode is not applicable to the instance.`
        /// * `KeepCharging`: standard mode. Billing of the instance continues after the instance is stopped, and resources are retained for the instance.
        /// * `StopCharging`: economical mode. Billing of some resources of the instance stops after the instance is stopped. When the instance is stopped, its resources such as vCPUs, memory, and public IP address are released. You may be unable to restart the instance if some types of resources are out of stock in the current region.
        /// </summary>
        [Input("stoppedMode")]
        public Input<string>? StoppedMode { get; set; }

        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

        /// <summary>
        /// The ID of the automatic snapshot policy applied to the system disk.
        /// </summary>
        [Input("systemDiskAutoSnapshotPolicyId")]
        public Input<string>? SystemDiskAutoSnapshotPolicyId { get; set; }

        /// <summary>
        /// Valid values are `ephemeral_ssd`, `cloud_efficiency`, `cloud_ssd`, `cloud_essd`, `cloud`, `cloud_auto`. only is used to some none I/O optimized instance. Default to `cloud_efficiency`. Valid values `cloud_auto` Available in 1.184.0+.
        /// </summary>
        [Input("systemDiskCategory")]
        public Input<string>? SystemDiskCategory { get; set; }

        /// <summary>
        /// The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
        /// </summary>
        [Input("systemDiskDescription")]
        public Input<string>? SystemDiskDescription { get; set; }

        /// <summary>
        /// The algorithm to be used to encrypt the system disk. Valid values are `aes-256`, `sm4-128`. Default value is `aes-256`.
        /// </summary>
        [Input("systemDiskEncryptAlgorithm")]
        public Input<string>? SystemDiskEncryptAlgorithm { get; set; }

        /// <summary>
        /// Specifies whether to encrypt the system disk. Valid values: `true`,`false`. Default value: `false`.
        /// - `true`: encrypts the system disk.
        /// - `false`: does not encrypt the system disk.
        /// </summary>
        [Input("systemDiskEncrypted")]
        public Input<bool>? SystemDiskEncrypted { get; set; }

        /// <summary>
        /// The ID of the Key Management Service (KMS) key to be used for the system disk.
        /// </summary>
        [Input("systemDiskKmsKeyId")]
        public Input<string>? SystemDiskKmsKeyId { get; set; }

        /// <summary>
        /// The name of the system disk. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
        /// </summary>
        [Input("systemDiskName")]
        public Input<string>? SystemDiskName { get; set; }

        /// <summary>
        /// The performance level of the ESSD used as the system disk, Valid values: `PL0`, `PL1`, `PL2`, `PL3`, Default to `PL1`;For more information about ESSD, See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/122389.htm).
        /// </summary>
        [Input("systemDiskPerformanceLevel")]
        public Input<string>? SystemDiskPerformanceLevel { get; set; }

        /// <summary>
        /// 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}.
        /// </summary>
        [Input("systemDiskSize")]
        public Input<int>? SystemDiskSize { get; set; }

        /// <summary>
        /// The ID of the dedicated block storage cluster. If you want to use disks in a dedicated block storage cluster as system disks when you create instances, you must specify this parameter. For more information about dedicated block storage clusters, see [What is Dedicated Block Storage Cluster?](https://www.alibabacloud.com/help/en/elastic-compute-service/latest/dedicated-block-storage-clusters-overview).
        /// </summary>
        [Input("systemDiskStorageClusterId")]
        public Input<string>? SystemDiskStorageClusterId { get; set; }

        [Input("tags")]
        private InputMap<string>? _tags;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<string> Tags
        {
            get => _tags ?? (_tags = new InputMap<string>());
            set => _tags = value;
        }

        /// <summary>
        /// User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance.
        /// It supports to setting a base64-encoded value, and it is the recommended usage.
        /// 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).
        /// </summary>
        [Input("userData")]
        public Input<string>? UserData { get; set; }

        [Input("volumeTags")]
        private InputMap<object>? _volumeTags;

        /// <summary>
        /// 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.
        /// </summary>
        public InputMap<object> VolumeTags
        {
            get => _volumeTags ?? (_volumeTags = new InputMap<object>());
            set => _volumeTags = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        public InstanceState()
        {
        }
        public static new InstanceState Empty => new InstanceState();
    }
}
