Skip to content

Instance

This class encapsulates and extends the ROS resource type ALIYUN::ECS::Instance.

Initializers

import ros_cdk_ecs
ros_cdk_ecs.Instance(
  scope: Construct,
  id: str,
  instance_type: typing.Union[str, IResolvable],
  affinity: typing.Union[str, IResolvable] = None,
  allocate_public_ip: typing.Union[bool, IResolvable] = None,
  auto_renew: typing.Union[str, IResolvable] = None,
  auto_renew_period: typing.Union[typing.Union[int, float], IResolvable] = None,
  credit_specification: typing.Union[str, IResolvable] = None,
  dedicated_host_id: typing.Union[str, IResolvable] = None,
  deletion_protection: typing.Union[bool, IResolvable] = None,
  deployment_set_group_no: typing.Union[typing.Union[int, float], IResolvable] = None,
  deployment_set_id: typing.Union[str, IResolvable] = None,
  description: typing.Union[str, IResolvable] = None,
  disk_mappings: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, DiskMappingsProperty]]] = None,
  host_name: typing.Union[str, IResolvable] = None,
  hpc_cluster_id: typing.Union[str, IResolvable] = None,
  http_endpoint: typing.Union[str, IResolvable] = None,
  http_tokens: typing.Union[str, IResolvable] = None,
  image_family: typing.Union[str, IResolvable] = None,
  image_id: typing.Union[str, IResolvable] = None,
  instance_charge_type: typing.Union[str, IResolvable] = None,
  instance_name: typing.Union[str, IResolvable] = None,
  internet_charge_type: typing.Union[str, IResolvable] = None,
  internet_max_bandwidth_out: typing.Union[typing.Union[int, float], IResolvable] = None,
  io_optimized: typing.Union[str, IResolvable] = None,
  key_pair_name: typing.Union[str, IResolvable] = None,
  password: typing.Union[str, IResolvable] = None,
  password_inherit: typing.Union[bool, IResolvable] = None,
  period: typing.Union[typing.Union[int, float], IResolvable] = None,
  period_unit: typing.Union[str, IResolvable] = None,
  private_ip_address: typing.Union[str, IResolvable] = None,
  private_pool_options: typing.Union[IResolvable, PrivatePoolOptionsProperty] = None,
  ram_role_name: typing.Union[str, IResolvable] = None,
  resource_group_id: typing.Union[str, IResolvable] = None,
  security_enhancement_strategy: typing.Union[str, IResolvable] = None,
  security_group_id: typing.Union[str, IResolvable] = None,
  security_group_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  spot_duration: typing.Union[typing.Union[int, float], IResolvable] = None,
  spot_interruption_behavior: typing.Union[str, IResolvable] = None,
  spot_price_limit: typing.Union[str, IResolvable] = None,
  spot_strategy: typing.Union[str, IResolvable] = None,
  storage_set_id: typing.Union[str, IResolvable] = None,
  storage_set_partition_number: typing.Union[typing.Union[int, float], IResolvable] = None,
  subscription_deletion_force: typing.Union[bool, IResolvable] = None,
  system_disk_category: typing.Union[str, IResolvable] = None,
  system_disk_description: typing.Union[str, IResolvable] = None,
  system_disk_disk_name: typing.Union[str, IResolvable] = None,
  system_disk_performance_level: typing.Union[str, IResolvable] = None,
  system_disk_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  tags: typing.List[TagsProperty] = None,
  tenancy: typing.Union[str, IResolvable] = None,
  use_additional_service: typing.Union[bool, IResolvable] = None,
  user_data: typing.Union[str, IResolvable] = None,
  vpc_id: typing.Union[str, IResolvable] = None,
  v_switch_id: typing.Union[str, IResolvable] = None,
  zone_id: typing.Union[str, IResolvable] = None,
  zone_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
instance_type typing.Union[str, ros_cdk_core.IResolvable] Property instanceType: Ecs instance supported instance type, make sure it should be correct.
affinity typing.Union[str, ros_cdk_core.IResolvable] Property affinity: Specifies whether to associate the instance on a dedicated host with the dedicated host.
allocate_public_ip typing.Union[bool, ros_cdk_core.IResolvable] Property allocatePublicIp: The public ip for ecs instance, if properties is true, will allocate public ip.
auto_renew typing.Union[str, ros_cdk_core.IResolvable] Property autoRenew: Whether renew the fee automatically?
auto_renew_period typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property autoRenewPeriod: The time period of auto renew.
credit_specification typing.Union[str, ros_cdk_core.IResolvable] Property creditSpecification: The performance mode of the burstable instance.
dedicated_host_id typing.Union[str, ros_cdk_core.IResolvable] Property dedicatedHostId: The ID of the dedicated host.
deletion_protection typing.Union[bool, ros_cdk_core.IResolvable] Property deletionProtection: Whether an instance can be released manually through the console or API, deletion protection only support postPaid instance.
deployment_set_group_no typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property deploymentSetGroupNo: The number of the deployment set group to which to deploy the instance.
deployment_set_id typing.Union[str, ros_cdk_core.IResolvable] Property deploymentSetId: Deployment set ID.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Description of the instance, [2, 256] characters.
disk_mappings typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DiskMappingsProperty]]] Property diskMappings: Disk mappings to attach to instance.
host_name typing.Union[str, ros_cdk_core.IResolvable] Property hostName: Host name of created ecs instance.
hpc_cluster_id typing.Union[str, ros_cdk_core.IResolvable] Property hpcClusterId: The ID of the high performance computing (HPC) cluster to which the instance belongs.
http_endpoint typing.Union[str, ros_cdk_core.IResolvable] Property httpEndpoint: Specifies whether the access channel is enabled for instance metadata.
http_tokens typing.Union[str, ros_cdk_core.IResolvable] Property httpTokens: Specifies whether the security hardening mode (IMDSv2) is forcefully used to access instance metadata.
image_family typing.Union[str, ros_cdk_core.IResolvable] Property imageFamily: The name of the image family.
image_id typing.Union[str, ros_cdk_core.IResolvable] Property imageId: The image ID.
instance_charge_type typing.Union[str, ros_cdk_core.IResolvable] Property instanceChargeType: Instance Charge type, allowed value: Prepaid and Postpaid.
instance_name typing.Union[str, ros_cdk_core.IResolvable] Property instanceName: Display name of the instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
internet_charge_type typing.Union[str, ros_cdk_core.IResolvable] Property internetChargeType: Instance internet access charge type.Support 'PayByBandwidth' and 'PayByTraffic' only. Default is PayByTraffic.
internet_max_bandwidth_out typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property internetMaxBandwidthOut: The maximum outbound public bandwidth.
io_optimized typing.Union[str, ros_cdk_core.IResolvable] Property ioOptimized: Specifies whether the instance is I\/O optimized.
key_pair_name typing.Union[str, ros_cdk_core.IResolvable] Property keyPairName: SSH key pair name.
password typing.Union[str, ros_cdk_core.IResolvable] Property password: Password of created ecs instance.
password_inherit typing.Union[bool, ros_cdk_core.IResolvable] Property passwordInherit: Specifies whether to use the password preset in the image.
period typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property period: Prepaid time period.
period_unit typing.Union[str, ros_cdk_core.IResolvable] Property periodUnit: Unit of prepaid time period, it could be Week\/Month\/Year.
private_ip_address typing.Union[str, ros_cdk_core.IResolvable] Property privateIpAddress: Private IP for the instance created.
private_pool_options typing.Union[ros_cdk_core.IResolvable, PrivatePoolOptionsProperty] Property privatePoolOptions: The options of the private pool.
ram_role_name typing.Union[str, ros_cdk_core.IResolvable] Property ramRoleName: Instance RAM role name.
resource_group_id typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: Resource group id.
security_enhancement_strategy typing.Union[str, ros_cdk_core.IResolvable] Property securityEnhancementStrategy: Specifies whether to enable security hardening.
security_group_id typing.Union[str, ros_cdk_core.IResolvable] Property securityGroupId: Security group to create ecs instance.
security_group_ids typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property securityGroupIds: The ID list of security group to which to assign the instance.
spot_duration typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property spotDuration: The protection period of the spot instance.
spot_interruption_behavior typing.Union[str, ros_cdk_core.IResolvable] Property spotInterruptionBehavior: The interruption mode of the spot instance.
spot_price_limit typing.Union[str, ros_cdk_core.IResolvable] Property spotPriceLimit: The hourly price threshold of a instance, and it takes effect only when parameter InstanceChargeType is PostPaid.
spot_strategy typing.Union[str, ros_cdk_core.IResolvable] Property spotStrategy: The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter InstanceChargeType is PostPaid.
storage_set_id typing.Union[str, ros_cdk_core.IResolvable] Property storageSetId: The storage set ID.
storage_set_partition_number typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property storageSetPartitionNumber: The maximum number of partitions in the storage set.
subscription_deletion_force typing.Union[bool, ros_cdk_core.IResolvable] Property subscriptionDeletionForce: This option is only applicable to subscription instances.
system_disk_category typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskCategory: Category of system disk.
system_disk_description typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskDescription: Description of created system disk.
system_disk_disk_name typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskDiskName: Name of created system disk.
system_disk_performance_level typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskPerformanceLevel: The performance level of the enhanced SSD used as the system disk.Default value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random read\/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read\/write IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read\/write IOPS.PL3: A single enhanced SSD delivers up to 1,000,000 random read\/write IOPS.
system_disk_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property systemDiskSize: Disk size of the system disk, range from 20 to 500 GB.
tags typing.List[TagsProperty] Property tags: Tags to attach to instance.
tenancy typing.Union[str, ros_cdk_core.IResolvable] Property tenancy: Specifies whether to create the instance on a dedicated host.
use_additional_service typing.Union[bool, ros_cdk_core.IResolvable] Property useAdditionalService: Specifies whether to use the system configurations for virtual machines provided by Alibaba Cloud.
user_data typing.Union[str, ros_cdk_core.IResolvable] Property userData: The user data of the instance.
vpc_id typing.Union[str, ros_cdk_core.IResolvable] Property vpcId: The VPC id to create ecs instance.
v_switch_id typing.Union[str, ros_cdk_core.IResolvable] Property vSwitchId: The ID of the vSwitch to which to connect to the instance.
zone_id typing.Union[str, ros_cdk_core.IResolvable] Property zoneId: The ID of the zone to which the instance belongs.
zone_ids typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property zoneIds: Zone ids for query parameters.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

instance_typeRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property instanceType: Ecs instance supported instance type, make sure it should be correct.


affinityOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property affinity: Specifies whether to associate the instance on a dedicated host with the dedicated host.

Valid values:

  • default: does not associate the ECS instance with the dedicated host. When you start an instance that was stopped in economical mode, the instance is automatically deployed to another dedicated host in the automatic deployment resource pool if the available resources of the original dedicated host are insufficient.
  • host: associates the ECS instance with the dedicated host. When you start an instance that was stopped in economical mode, the instance remains on the original dedicated host. If the available resources of the original dedicated host are insufficient, the instance cannot start. Default value: default.

allocate_public_ipOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property allocatePublicIp: The public ip for ecs instance, if properties is true, will allocate public ip.

If property InternetMaxBandwidthOut set to 0, it will not assign public ip.


auto_renewOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property autoRenew: Whether renew the fee automatically?

When the parameter InstanceChargeType is PrePaid, it will take effect. Range of value:True: automatic renewal.False: no automatic renewal. Default value is False.


auto_renew_periodOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property autoRenewPeriod: The time period of auto renew.

When the parameter InstanceChargeType is PrePaid, it will take effect.It could be 1, 2, 3, 6, 12, 24, 36, 48, 60. Default value is 1.


credit_specificationOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property creditSpecification: The performance mode of the burstable instance.

Valid values:

  • Standard: the standard mode.
  • Unlimited: the unlimited mode.

dedicated_host_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property dedicatedHostId: The ID of the dedicated host.

You can call the DescribeDedicatedHosts operation to query the list of dedicated host IDs.

Spot instances cannot be created on dedicated hosts. If you specify DedicatedHostId, SpotStrategy and SpotPriceLimit are automatically ignored.


deletion_protectionOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property deletionProtection: Whether an instance can be released manually through the console or API, deletion protection only support postPaid instance.


deployment_set_group_noOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property deploymentSetGroupNo: The number of the deployment set group to which to deploy the instance.

If the deployment set specified by DeploymentSetId uses the high availability group strategy (AvailabilityGroup), you can use DeploymentSetGroupNo to specify a deployment set group in the deployment set. Valid values: 1 to 7.


deployment_set_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property deploymentSetId: Deployment set ID.


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: Description of the instance, [2, 256] characters.

Do not fill or empty, the default is empty.


disk_mappingsOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DiskMappingsProperty]]]

Property diskMappings: Disk mappings to attach to instance.

Max support 16 disks. If the image contains a data disk, you can specify other parameters of the data disk via the same value of parameter "Device". If parameter "Category" is not specified, it will be cloud_efficiency instead of "Category" of data disk in the image.


host_nameOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property hostName: Host name of created ecs instance.

at least 2 characters, and '.' '-' Is not the first and last characters as hostname, not continuous use. Windows platform can be up to 15 characters, allowing letters (without limiting case), numbers and '-', and does not support the number of points, not all is digital ('.').Other (Linux, etc.) platform up to 64 characters, allowing support number multiple points for the period between the points, each permit letters (without limiting case), numbers and '-' components.


hpc_cluster_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property hpcClusterId: The ID of the high performance computing (HPC) cluster to which the instance belongs.

This parameter is required when you create instances of a Supper Computing Cluster (SCC) instance type. For information about how to create an HPC cluster, see CreateHpcCluster.


http_endpointOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property httpEndpoint: Specifies whether the access channel is enabled for instance metadata.

Valid values:

  • enabled
  • disabled Default value: enabled.

http_tokensOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property httpTokens: Specifies whether the security hardening mode (IMDSv2) is forcefully used to access instance metadata.

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. Default value: optional.

image_familyOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property imageFamily: The name of the image family.

You can set this parameter to obtain the latest available custom image from the specified image family to create the instance.

  • ImageFamily must be empty if ImageId is specified.
  • ImageFamily can be specified if ImageId is not specified.

image_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property imageId: The image ID.

Naming convention for image IDs <\/summary> - Public images: Named based on the operating system version, architecture, language, and published date. - Custom images, shared images, cloud marketplace images, and community images: Start with the letter `m`. <\/details> --- ### `instance_charge_type`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property instanceChargeType: Instance Charge type, allowed value: Prepaid and Postpaid. If specified Prepaid, please ensure you have sufficient balance in your account. Or instance creation will be failure. Default value is Postpaid. --- ### `instance_name`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property instanceName: Display name of the instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'. --- ### `internet_charge_type`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property internetChargeType: Instance internet access charge type.Support 'PayByBandwidth' and 'PayByTraffic' only. Default is PayByTraffic. --- ### `internet_max_bandwidth_out`Optional - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property internetMaxBandwidthOut: The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0. --- ### `io_optimized`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property ioOptimized: Specifies whether the instance is I\/O optimized. For instances of [retired instance types](), the default value is none. For instances of other instance types, the default value is optimized. Valid values: * none: The instance is not I/O optimized. * optimized: The instance is I/O optimized. --- ### `key_pair_name`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property keyPairName: SSH key pair name. --- ### `password`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property password: Password of created ecs instance. Must contain at least 3 types of special character, lower character, upper character, number. --- ### `password_inherit`Optional - *Type:* typing.Union[bool, ros_cdk_core.IResolvable] Property passwordInherit: Specifies whether to use the password preset in the image. Valid values: * true: uses the preset password. * false: does not use the preset password. Default value: false. > If you set this parameter to true, make sure that you leave the Password > parameter empty and the selected image has a preset password. --- ### `period`Optional - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property period: Prepaid time period. Unit is month, it could be from 1 to 9 or 12, 24, 36, 48, 60. Default value is 1. --- ### `period_unit`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property periodUnit: Unit of prepaid time period, it could be Week\/Month\/Year. Default value is Month. --- ### `private_ip_address`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property privateIpAddress: Private IP for the instance created. Only works for VPC instance and cannot duplicated with existing instance. --- ### `private_pool_options`Optional - *Type:* typing.Union[ros_cdk_core.IResolvable, [PrivatePoolOptionsProperty](../Structs/PrivatePoolOptionsProperty.md)] Property privatePoolOptions: The options of the private pool. --- ### `ram_role_name`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property ramRoleName: Instance RAM role name. The name is provided and maintained by Resource Access Management (RAM) and can be queried using ListRoles. For more information, see RAM API CreateRole and ListRoles. --- ### `resource_group_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: Resource group id. --- ### `security_enhancement_strategy`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property securityEnhancementStrategy: Specifies whether to enable security hardening. Valid values: * Active: enables security hardening. This value is applicable only to public images. * Deactive: does not enable security hardening. This value is applicable to all images. --- ### `security_group_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property securityGroupId: Security group to create ecs instance. For classic instance need the security group not belong to VPC, for VPC instance, please make sure the security group belong to specified VPC. --- ### `security_group_ids`Optional - *Type:* typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property securityGroupIds: The ID list of security group to which to assign the instance. The max length is based on the maximum number of security groups to which an instance can belong. For more information, see the "Security group limits" section in Limits. --- ### `spot_duration`Optional - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property spotDuration: The protection period of the spot instance. Unit: hours. Valid values: * 1: After a spot instance is created, the system ensures that the instance is not automatically released within 1 hour. After the 1-hour protection period ends, the system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance. * 0: After a spot instance is created, the system does not ensure that the instance can run for one hour. The system compares the biding price with the market prices and checks the resource inventory to determine whether to retain or release the instance. Default value: 1. > * You can set this parameter only to 0 or 1. * The spot instance is billed by second. Specify an appropriate protection period. * The system sends an ECS system event to notify you 5 minutes before the instance is released. --- ### `spot_interruption_behavior`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property spotInterruptionBehavior: The interruption mode of the spot instance. Valid values: * Terminate: The instance is released. * Stop: The instance is stopped in economical mode. For information about the economical mode, see [Economical mode](). Default value: Terminate. --- ### `spot_price_limit`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property spotPriceLimit: The hourly price threshold of a instance, and it takes effect only when parameter InstanceChargeType is PostPaid. Three decimals is allowed at most. --- ### `spot_strategy`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property spotStrategy: The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter InstanceChargeType 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. "Default value: NoSpot. --- ### `storage_set_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property storageSetId: The storage set ID. --- ### `storage_set_partition_number`Optional - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property storageSetPartitionNumber: The maximum number of partitions in the storage set. Valid values: integers greater than or equal to 2. --- ### `subscription_deletion_force`Optional - *Type:* typing.Union[bool, ros_cdk_core.IResolvable] Property subscriptionDeletionForce: This option is only applicable to subscription instances. For subscription instances, if this option is true, the instance will be converted to a postpaid instance before being deleted. If false, the forced deletion will not be performed. This operation will incur additional fees, so choose carefully. --- ### `system_disk_category`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskCategory: Category of system disk. Default is cloud_efficiency. support cloud|cloud_efficiency|cloud_ssd|cloud_essd|ephemeral_ssd|cloud_auto|cloud_essd_entry --- ### `system_disk_description`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskDescription: Description of created system disk. --- ### `system_disk_disk_name`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskDiskName: Name of created system disk. --- ### `system_disk_performance_level`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property systemDiskPerformanceLevel: The performance level of the enhanced SSD used as the system disk.Default value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random read\/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read\/write IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read\/write IOPS.PL3: A single enhanced SSD delivers up to 1,000,000 random read\/write IOPS. --- ### `system_disk_size`Optional - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property systemDiskSize: Disk size of the system disk, range from 20 to 500 GB. If you specify with your own image, make sure the system disk size bigger than image size. --- ### `tags`Optional - *Type:* typing.List[[TagsProperty](../Structs/TagsProperty.md)] Property tags: Tags to attach to instance. Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required. --- ### `tenancy`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property tenancy: Specifies whether to create the instance on a dedicated host. Valid values: * **default**: creates the instance on a non-dedicated host. * **host**: creates the instance on a dedicated host. If you do not specify **DedicatedHostId**, Alibaba Cloud selects a dedicated host for the instance. Default value: **default**. --- ### `use_additional_service`Optional - *Type:* typing.Union[bool, ros_cdk_core.IResolvable] Property useAdditionalService: Specifies whether to use the system configurations for virtual machines provided by Alibaba Cloud. System configurations for Windows: NTP and KMS. System configurations for Linux: NTP and YUM. --- ### `user_data`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property userData: The user data of the instance. You must specify Base64-encoded data. The instance user data cannot exceed 32 KB in size before Base64 encoding. For information about the limits, formats, and running frequencies of instance user data, see [Instance user data](). > To ensure security, we recommend that you do not use plaintext to pass in > confidential information, such as passwords or private keys, as user data. If you > need to pass in confidential information, we recommend that you encrypt and > encode the information in Base64 and then decode and decrypt the information in > the same manner in the instance. --- ### `vpc_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property vpcId: The VPC id to create ecs instance. --- ### `v_switch_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property vSwitchId: The ID of the vSwitch to which to connect to the instance. You must set this parameter when you create an instance of the VPC type. The specified vSwitch and security group must belong to the same VPC. You can call the [DescribeVSwitches]() operation to query available vSwitches. Take note of the following items: * If you specify the `VSwitchId` parameter, the zone specified by the `ZoneId` parameter must be the zone where the specified vSwitch is located. You can also leave the `ZoneId` parameter empty. Then, the system selects the zone where the specified vSwitch resides. * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `VSwitchId` but can specify `NetworkInterface.N.VSwitchId`. --- ### `zone_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Property zoneId: The ID of the zone to which the instance belongs. For more information, call the DescribeZones operation to query the most recent zone list. Default value is empty, which means random selection. --- ### `zone_ids`Optional - *Type:* typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property zoneIds: Zone ids for query parameters. --- ### `enable_resource_property_constraint`Optional - *Type:* bool --- ## Methods | **Name** | **Description** | | --- | --- | | to_string | Returns a string representation of this construct. | | synthesize | Allows this construct to emit artifacts into the cloud assembly during synthesis. | | add_condition | *No description.* | | add_count | *No description.* | | add_dependency | *No description.* | | add_resource_desc | *No description.* | | apply_removal_policy | *No description.* | | fetch_condition | *No description.* | | fetch_dependency | *No description.* | | fetch_resource_desc | *No description.* | | get_att | *No description.* | | set_metadata | *No description.* | | add_security_groups | Add one or more security groups to an ECS instance. | | add_user_data_commands | Add one or more commands to the userdata of an ECS instance. | | auto_create_dependencies | Create prerequisite resource(s) required to an ECS instance: VPC, VSwitch, and(or) security group. | --- ### `to_string`
def to_string() -> str
Returns a string representation of this construct. ### `synthesize`
def synthesize(
  session: ISynthesisSession
) -> None
Allows this construct to emit artifacts into the cloud assembly during synthesis. This method is usually implemented by framework-level constructs such as `Stack` and `Asset` as they participate in synthesizing the cloud assembly. `session`Required - *Type:* ros_cdk_core.ISynthesisSession The synthesis session. --- ### `add_condition`
def add_condition(
  condition: RosCondition
) -> None
`condition`Required - *Type:* ros_cdk_core.RosCondition --- ### `add_count`
def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
`count`Required - *Type:* typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] --- ### `add_dependency`
def add_dependency(
  resource: Resource
) -> None
`resource`Required - *Type:* ros_cdk_core.Resource --- ### `add_resource_desc`
def add_resource_desc(
  desc: str
) -> None
`desc`Required - *Type:* str --- ### `apply_removal_policy`
def apply_removal_policy(
  policy: RemovalPolicy
) -> None
`policy`Required - *Type:* ros_cdk_core.RemovalPolicy --- ### `fetch_condition`
def fetch_condition() -> RosCondition
### `fetch_dependency`
def fetch_dependency() -> typing.List[str]
### `fetch_resource_desc`
def fetch_resource_desc() -> str
### `get_att`
def get_att(
  name: str
) -> IResolvable
`name`Required - *Type:* str --- ### `set_metadata`
def set_metadata(
  key: str,
  value: typing.Any
) -> None
`key`Required - *Type:* str --- `value`Required - *Type:* typing.Any --- ### `add_security_groups`
def add_security_groups(
  security_groups: typing.Union[str, SecurityGroup]
) -> None
Add one or more security groups to an ECS instance. `security_groups`Required - *Type:* typing.Union[str, SecurityGroup] Security groups or security group IDs. --- ### `add_user_data_commands`
def add_user_data_commands(
  commands: typing.Union[str, IResolvable]
) -> None
Add one or more commands to the userdata of an ECS instance. `commands`Required - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Commands to be added. --- ### `auto_create_dependencies`
def auto_create_dependencies(
  zone_id: typing.Union[str, IResolvable] = None,
  vpc_cidr_block: str = None,
  v_switch_cidr_block: str = None,
  whether_create_security_group: bool = None
) -> typing.List[typing.Any]
Create prerequisite resource(s) required to an ECS instance: VPC, VSwitch, and(or) security group. `zone_id`Optional - *Type:* typing.Union[str, ros_cdk_core.IResolvable] Required when creating a VSwitch. --- `vpc_cidr_block`Optional - *Type:* str Optional when creating a VPC. Default value is 192.168.0.0/16. --- `v_switch_cidr_block`Optional - *Type:* str Optional when creating a VSwitch. Default value is 192.168.0.0/24. --- `whether_create_security_group`Optional - *Type:* bool Whether to create a security group. Default value is true. --- ## Static Functions | **Name** | **Description** | | --- | --- | | is_construct | Return whether the given object is a Construct. | --- ### `is_construct`
import ros_cdk_ecs
ros_cdk_ecs.Instance.is_construct(
  x: typing.Any
)
Return whether the given object is a Construct. `x`Required - *Type:* typing.Any --- ## Properties | **Name** | **Type** | **Description** | | --- | --- | --- | | node | ros_cdk_core.ConstructNode | The construct tree node associated with this construct. | | env | ros_cdk_core.IResourceEnvironment | The environment this resource belongs to. | | ref | str | *No description.* | | stack | ros_cdk_core.Stack | The stack in which this resource is defined. | | resource | ros_cdk_core.RosResource | *No description.* | | attr_host_name | typing.Union[str, ros_cdk_core.IResolvable] | Attribute HostName: Host name of created instance. | | attr_inner_ip | typing.Union[str, ros_cdk_core.IResolvable] | Attribute InnerIp: Inner IP address of the specified instance. | | attr_instance_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute InstanceId: The instance ID of created ecs instance. | | attr_primary_network_interface_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance. | | attr_private_ip | typing.Union[str, ros_cdk_core.IResolvable] | Attribute PrivateIp: Private IP address of created ecs instance. | | attr_public_ip | typing.Union[str, ros_cdk_core.IResolvable] | Attribute PublicIp: Public IP address of created ecs instance. | | attr_security_group_ids | typing.Union[str, ros_cdk_core.IResolvable] | Attribute SecurityGroupIds: Security group ID list of created instance. | | attr_zone_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute ZoneId: Zone ID of created instance. | | props | [InstanceProps](../Structs/InstanceProps.md) | *No description.* | --- ### `node`Required
node: ConstructNode
- *Type:* ros_cdk_core.ConstructNode The construct tree node associated with this construct. --- ### `env`Required
env: IResourceEnvironment
- *Type:* ros_cdk_core.IResourceEnvironment The environment this resource belongs to. For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into. --- ### `ref`Required
ref: str
- *Type:* str --- ### `stack`Required
stack: Stack
- *Type:* ros_cdk_core.Stack The stack in which this resource is defined. --- ### `resource`Optional
resource: RosResource
- *Type:* ros_cdk_core.RosResource --- ### `attr_host_name`Required
attr_host_name: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute HostName: Host name of created instance. --- ### `attr_inner_ip`Required
attr_inner_ip: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute InnerIp: Inner IP address of the specified instance. Only for classical instance. --- ### `attr_instance_id`Required
attr_instance_id: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute InstanceId: The instance ID of created ecs instance. --- ### `attr_primary_network_interface_id`Required
attr_primary_network_interface_id: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance. --- ### `attr_private_ip`Required
attr_private_ip: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute PrivateIp: Private IP address of created ecs instance. Only for VPC instance. --- ### `attr_public_ip`Required
attr_public_ip: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute PublicIp: Public IP address of created ecs instance. --- ### `attr_security_group_ids`Required
attr_security_group_ids: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute SecurityGroupIds: Security group ID list of created instance. --- ### `attr_zone_id`Required
attr_zone_id: typing.Union[str, IResolvable]
- *Type:* typing.Union[str, ros_cdk_core.IResolvable] Attribute ZoneId: Zone ID of created instance. --- ### `props`Required
props: InstanceProps
- *Type:* [InstanceProps](../Structs/InstanceProps.md) ---