Instance
Create a Instance Resource
new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);def Instance(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, status=None, subnet_id=None, system_disk_auto_snapshot_policy_id=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None, volume_tags=None, vswitch_id=None, __props__=None);func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Instance Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Instance resource accepts the following input properties:
- Image
Id string 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.
- Instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- Security
Groups List<string> A list of security group ids to associate with.
- Allocate
Public boolIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 intPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- Availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- Credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- Data
Disks List<Pulumi.Ali Cloud. Ecs. Inputs. Instance Data Disk Args> The list of data disks created with instance.
- Deletion
Protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- Description string
The description of the data disk.
- Dry
Run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- Force
Delete 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 string 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.
- Include
Data boolDisks Whether to change instance disks charge type when changing instance charge type.
- Instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- Instance
Name string - Internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- Internet
Max intBandwidth 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.
- Internet
Max intBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- Io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- Is
Outdated bool Whether to use outdated instance type. Default to false.
- Key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- Kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- Kms
Encryption Dictionary<string, object>Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- Password string
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 int
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- Period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- Private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- Renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- Role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- Security
Enhancement stringStrategy 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.
- Spot
Price doubleLimit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- Subnet
Id string - System
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- System
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- System
Disk intSize 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}.
- Dictionary<string, string>
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 string 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.
- Dictionary<string, object>
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 string 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.
- Image
Id string 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.
- Instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- Security
Groups []string A list of security group ids to associate with.
- Allocate
Public boolIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 intPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- Availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- Credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- Data
Disks []InstanceData Disk The list of data disks created with instance.
- Deletion
Protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- Description string
The description of the data disk.
- Dry
Run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- Force
Delete 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 string 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.
- Include
Data boolDisks Whether to change instance disks charge type when changing instance charge type.
- Instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- Instance
Name string - Internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- Internet
Max intBandwidth 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.
- Internet
Max intBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- Io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- Is
Outdated bool Whether to use outdated instance type. Default to false.
- Key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- Kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- Kms
Encryption map[string]interface{}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- Password string
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 int
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- Period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- Private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- Renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- Role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- Security
Enhancement stringStrategy 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.
- Spot
Price float64Limit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- Subnet
Id string - System
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- System
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- System
Disk intSize 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}.
- map[string]string
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 string 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.
- map[string]interface{}
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 string 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.
- image
Id string 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.
- instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- security
Groups string[] A list of security group ids to associate with.
- allocate
Public booleanIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 numberPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- data
Disks InstanceData Disk[] The list of data disks created with instance.
- deletion
Protection boolean Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- description string
The description of the data disk.
- dry
Run boolean 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- force
Delete boolean 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 string 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.
- include
Data booleanDisks Whether to change instance disks charge type when changing instance charge type.
- instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- instance
Name string - internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- internet
Max numberBandwidth 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.
- internet
Max numberBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- is
Outdated boolean Whether to use outdated instance type. Default to false.
- key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- kms
Encryption {[key: string]: any}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- password string
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 number
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- security
Enhancement stringStrategy 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.
- spot
Price numberLimit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- subnet
Id string - system
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- system
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- system
Disk numberSize 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}.
- {[key: string]: string}
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 string 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.
- {[key: string]: any}
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 string 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.
- image_
id 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.
- instance_
type str The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- security_
groups List[str] A list of security group ids to associate with.
- allocate_
public_ boolip 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_ strtime The automatic release time of the
PostPaidinstance. 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_ floatperiod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- availability_
zone str The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- credit_
specification str Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- data_
disks List[InstanceData Disk] The list of data disks created with instance.
- deletion_
protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- description str
The description of the data disk.
- dry_
run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- force_
delete 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 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 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.
- include_
data_ booldisks Whether to change instance disks charge type when changing instance charge type.
- instance_
charge_ strtype Valid values are
PrePaid,PostPaid, The default isPostPaid.- instance_
name str - internet_
charge_ strtype Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- internet_
max_ floatbandwidth_ 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.
- internet_
max_ floatbandwidth_ out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- io_
optimized str It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- is_
outdated bool Whether to use outdated instance type. Default to false.
- key_
name 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_ strpassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- kms_
encryption_ Dict[str, Any]context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- password 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 float
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- period_
unit str The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- private_
ip str Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- renewal_
status str Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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_ strid The Id of resource group which the instance belongs.
- role_
name str Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- security_
enhancement_ strstrategy 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.
- spot_
price_ floatlimit 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 str The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 str
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- subnet_
id str - system_
disk_ strauto_ snapshot_ policy_ id The ID of the automatic snapshot policy applied to the system disk.
- system_
disk_ strcategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- system_
disk_ floatsize 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}.
- Dict[str, str]
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 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.
- Dict[str, Any]
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 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:
Look up an Existing Instance Resource
Get an existing Instance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: InstanceState, opts?: CustomResourceOptions): Instancestatic 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_auto_snapshot_policy_id=None, system_disk_category=None, system_disk_size=None, tags=None, user_data=None, volume_tags=None, vswitch_id=None, __props__=None);func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Allocate
Public boolIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 intPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- Availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- Credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- Data
Disks List<Pulumi.Ali Cloud. Ecs. Inputs. Instance Data Disk Args> The list of data disks created with instance.
- Deletion
Protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- Description string
The description of the data disk.
- Dry
Run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- Force
Delete 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 string 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.
- Image
Id string 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 boolDisks Whether to change instance disks charge type when changing instance charge type.
- Instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- Instance
Name string - Instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- Internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- Internet
Max intBandwidth 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.
- Internet
Max intBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- Io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- Is
Outdated bool Whether to use outdated instance type. Default to false.
- Key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- Kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- Kms
Encryption Dictionary<string, object>Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- Password string
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 int
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- Period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- Private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- Public
Ip string The instance public ip.
- Renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- Role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- Security
Enhancement stringStrategy 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 List<string> A list of security group ids to associate with.
- Spot
Price doubleLimit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- Subnet
Id string - System
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- System
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- System
Disk intSize 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}.
- Dictionary<string, string>
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 string 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.
- Dictionary<string, object>
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 string 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.
- Allocate
Public boolIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 intPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- Availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- Credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- Data
Disks []InstanceData Disk The list of data disks created with instance.
- Deletion
Protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- Description string
The description of the data disk.
- Dry
Run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- Force
Delete 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 string 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.
- Image
Id string 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 boolDisks Whether to change instance disks charge type when changing instance charge type.
- Instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- Instance
Name string - Instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- Internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- Internet
Max intBandwidth 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.
- Internet
Max intBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- Io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- Is
Outdated bool Whether to use outdated instance type. Default to false.
- Key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- Kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- Kms
Encryption map[string]interface{}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- Password string
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 int
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- Period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- Private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- Public
Ip string The instance public ip.
- Renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- Role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- Security
Enhancement stringStrategy 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 []string A list of security group ids to associate with.
- Spot
Price float64Limit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- Subnet
Id string - System
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- System
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- System
Disk intSize 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}.
- map[string]string
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 string 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.
- map[string]interface{}
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 string 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.
- allocate
Public booleanIp 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 stringTime The automatic release time of the
PostPaidinstance. 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 numberPeriod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- availability
Zone string The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- credit
Specification string Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- data
Disks InstanceData Disk[] The list of data disks created with instance.
- deletion
Protection boolean Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- description string
The description of the data disk.
- dry
Run boolean 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- force
Delete boolean 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 string 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.
- image
Id string 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 booleanDisks Whether to change instance disks charge type when changing instance charge type.
- instance
Charge stringType Valid values are
PrePaid,PostPaid, The default isPostPaid.- instance
Name string - instance
Type string The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- internet
Charge stringType Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- internet
Max numberBandwidth 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.
- internet
Max numberBandwidth Out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- io
Optimized string It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- is
Outdated boolean Whether to use outdated instance type. Default to false.
- key
Name string The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.
- kms
Encrypted stringPassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- kms
Encryption {[key: string]: any}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- password string
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 number
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- period
Unit string The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- private
Ip string Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- public
Ip string The instance public ip.
- renewal
Status string Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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 stringId The Id of resource group which the instance belongs.
- role
Name string Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- security
Enhancement stringStrategy 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 string[] A list of security group ids to associate with.
- spot
Price numberLimit 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 string The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 string
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- subnet
Id string - system
Disk stringAuto Snapshot Policy Id The ID of the automatic snapshot policy applied to the system disk.
- system
Disk stringCategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- system
Disk numberSize 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}.
- {[key: string]: string}
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 string 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.
- {[key: string]: any}
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 string 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.
- allocate_
public_ boolip 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_ strtime The automatic release time of the
PostPaidinstance. 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_ floatperiod Auto renewal period of an instance, in the unit of month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid value: - [1, 2, 3, 6, 12] whenperiod_unitin “Month” - [1, 2, 3] whenperiod_unitin “Week”- availability_
zone str The Zone to start the instance in. It is ignored and will be computed when set
vswitch_id.- credit_
specification str Performance mode of the t5 burstable instance. Valid values: ‘Standard’, ‘Unlimited’.
- data_
disks List[InstanceData Disk] The list of data disks created with instance.
- deletion_
protection bool Whether enable the deletion protection or not. - true: Enable deletion protection. - false: Disable deletion protection.
- description str
The description of the data disk.
- dry_
run 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
DryRunOperationerror code is returned. - false: A request is sent. If the validation succeeds, the instance is created.- force_
delete 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 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 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.
- image_
id 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_ booldisks Whether to change instance disks charge type when changing instance charge type.
- instance_
charge_ strtype Valid values are
PrePaid,PostPaid, The default isPostPaid.- instance_
name str - instance_
type str The type of instance to start. When it is changed, the instance will reboot to make the change take effect.
- internet_
charge_ strtype Internet charge type of the instance, Valid values are
PayByBandwidth,PayByTraffic. Default isPayByTraffic. At present, ‘PrePaid’ instance cannot change the value to “PayByBandwidth” from “PayByTraffic”.- internet_
max_ floatbandwidth_ 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.
- internet_
max_ floatbandwidth_ out Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: [0, 100]. Default to 0 Mbps.
- io_
optimized str It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.
- is_
outdated bool Whether to use outdated instance type. Default to false.
- key_
name 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_ strpassword An KMS encrypts password used to an instance. If the
passwordis filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.- kms_
encryption_ Dict[str, Any]context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating an instance withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set. When it is changed, the instance will reboot to make the change take effect.- password 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 float
The duration that you will buy the resource, in month. It is valid when
instance_charge_typeisPrePaid. Default to 1. Valid values: - [1-9, 12, 24, 36, 48, 60] whenperiod_unitin “Month” - [1-3] whenperiod_unitin “Week”- period_
unit str The duration unit that you will buy the resource. It is valid when
instance_charge_typeis ‘PrePaid’. Valid value: [“Week”, “Month”]. Default to “Month”.- private_
ip str Instance private IP address can be specified when you creating new instance. It is valid when
vswitch_idis specified. When it is changed, the instance will reboot to make the change take effect.- public_
ip str The instance public ip.
- renewal_
status str Whether to renew an ECS instance automatically or not. It is valid when
instance_charge_typeisPrePaid. 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_ strid The Id of resource group which the instance belongs.
- role_
name str Instance RAM role name. The name is provided and maintained by RAM. You can use
alicloud.ram.Roleto create a new one.- security_
enhancement_ strstrategy 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 List[str] A list of security group ids to associate with.
- spot_
price_ floatlimit 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 str The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter
instance_charge_typeis ‘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 str
The instance status. Valid values: [“Running”, “Stopped”]. You can control the instance start and stop through this parameter. Default to
Running.- subnet_
id str - system_
disk_ strauto_ snapshot_ policy_ id The ID of the automatic snapshot policy applied to the system disk.
- system_
disk_ strcategory Valid values are
ephemeral_ssd,cloud_efficiency,cloud_ssd,cloud_essd,cloud.cloudonly is used to some none I/O optimized instance. Default tocloud_efficiency.- system_
disk_ floatsize 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}.
- Dict[str, str]
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 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.
- Dict[str, Any]
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 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.
Supporting Types
InstanceDataDisk
- Size int
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]
- Auto
Snapshot stringPolicy Id The ID of the automatic snapshot policy applied to the system disk.
- Category string
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 tocloud_efficiency.- Delete
With boolInstance 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 string
The description of the data disk.
- Encrypted bool
-(Optional, Bool, ForceNew) Encrypted the data in this disk.
- Name string
The name of the data disk.
- Snapshot
Id string 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.
- Size int
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]
- Auto
Snapshot stringPolicy Id The ID of the automatic snapshot policy applied to the system disk.
- Category string
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 tocloud_efficiency.- Delete
With boolInstance 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 string
The description of the data disk.
- Encrypted bool
-(Optional, Bool, ForceNew) Encrypted the data in this disk.
- Name string
The name of the data disk.
- Snapshot
Id string 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.
- size number
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]
- auto
Snapshot stringPolicy Id The ID of the automatic snapshot policy applied to the system disk.
- category string
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 tocloud_efficiency.- delete
With booleanInstance 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 string
The description of the data disk.
- encrypted boolean
-(Optional, Bool, ForceNew) Encrypted the data in this disk.
- name string
The name of the data disk.
- snapshot
Id string 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.
- 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]
- auto
Snapshot strPolicy Id The ID of the automatic snapshot policy applied to the system disk.
- 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 tocloud_efficiency.- delete_
with_ boolinstance 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
-(Optional, Bool, ForceNew) Encrypted the data in this disk.
- name str
The name of the data disk.
- 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.