InstanceClone
This class encapsulates and extends the ROS resource type ALIYUN::ECS::InstanceClone, which is used to clone an Elastic Compute Service (ECS) instance.
Initializers
import ros_cdk_ecs
ros_cdk_ecs.InstanceClone(
scope: Construct,
id: str,
source_instance_id: typing.Union[str, IResolvable],
backend_server_weight: typing.Union[typing.Union[int, float], IResolvable] = None,
deletion_protection: typing.Union[bool, IResolvable] = None,
description: typing.Union[str, IResolvable] = None,
disk_mappings: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, DiskMappingsProperty]]] = None,
image_id: typing.Union[str, IResolvable] = None,
instance_charge_type: typing.Union[str, IResolvable] = None,
instance_name: typing.Union[str, IResolvable] = None,
internet_max_bandwidth_in: typing.Union[typing.Union[int, float], IResolvable] = None,
key_pair_name: typing.Union[str, IResolvable] = None,
load_balancer_id_to_attach: typing.Union[str, IResolvable] = None,
password: typing.Union[str, IResolvable] = None,
period: typing.Union[typing.Union[int, float], IResolvable] = None,
ram_role_name: typing.Union[str, IResolvable] = None,
resource_group_id: typing.Union[str, IResolvable] = None,
security_group_id: typing.Union[str, IResolvable] = None,
spot_price_limit: typing.Union[str, IResolvable] = None,
spot_strategy: typing.Union[str, IResolvable] = None,
tags: typing.List[TagsProperty] = None,
zone_id: 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. |
source_instance_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property sourceInstanceId: Source ecs instance used to copy properties to clone new ecs instance. |
backend_server_weight |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property backendServerWeight: The weight of backend server of load balancer. |
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. |
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. |
image_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property imageId: Image ID to create ecs instance. |
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_max_bandwidth_in |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property internetMaxBandwidthIn: Max internet out band width setting, unit in Mbps(Mega bit per second). |
key_pair_name |
typing.Union[str, ros_cdk_core.IResolvable] |
Property keyPairName: SSH key pair name. |
load_balancer_id_to_attach |
typing.Union[str, ros_cdk_core.IResolvable] |
Property loadBalancerIdToAttach: After the instance is created. |
password |
typing.Union[str, ros_cdk_core.IResolvable] |
Property password: Password of created ecs instance. |
period |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property period: Prepaid time period. |
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_group_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property securityGroupId: Security group to create ecs 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. |
tags |
typing.List[TagsProperty] |
Property tags: Tags to attach to instance. |
zone_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property zoneId: The ID of the zone to which the instance belongs. |
enable_resource_property_constraint |
bool |
No description. |
scopeRequired
- Type: ros_cdk_core.Construct
idRequired
- Type: str
source_instance_idRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sourceInstanceId: Source ecs instance used to copy properties to clone new ecs instance.
It will copy the InstanceType, ImageId, InternetChargeType, InternetMaxBandwidthIn, InternetMaxBandwidthOut and the system disk and data disk configurations. If the instance network is VPC, it will also clone the relative properties. If specified instance with more than one security group, it will use the first security group to create instance. you can also specify the SecurityGroupId to override it.
backend_server_weightOptional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property backendServerWeight: The weight of backend server of load balancer.
From 0 to 100, 0 means offline. Default is 100.
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.
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.
image_idOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property imageId: Image ID to create ecs instance.
instance_charge_typeOptional
- 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_nameOptional
- 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_max_bandwidth_inOptional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property internetMaxBandwidthIn: Max internet out band width setting, unit in Mbps(Mega bit per second).
The range is [0,200], default is 200 Mbps.
key_pair_nameOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property keyPairName: SSH key pair name.
load_balancer_id_to_attachOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property loadBalancerIdToAttach: After the instance is created.
Automatic attach it to the load balancer.
passwordOptional
- 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.
periodOptional
- 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.
ram_role_nameOptional
- 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_idOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property resourceGroupId: Resource group id.
security_group_idOptional
- 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.
spot_price_limitOptional
- 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_strategyOptional
- 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.
tagsOptional
- Type: typing.List[TagsProperty]
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.
zone_idOptional
- 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.
enable_resource_property_constraintOptional
- 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. |
get_att |
No description. |
set_metadata |
No description. |
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.
- Type: ros_cdk_core.ISynthesisSession
The synthesis session.
add_condition
def add_condition(
condition: RosCondition
) -> None
- Type: ros_cdk_core.RosCondition
add_count
def add_count(
count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
add_dependency
def add_dependency(
resource: Resource
) -> None
- Type: ros_cdk_core.Resource
add_resource_desc
def add_resource_desc(
desc: str
) -> None
- Type: str
apply_removal_policy
def apply_removal_policy(
policy: RemovalPolicy
) -> None
- Type: ros_cdk_core.RemovalPolicy
get_att
def get_att(
name: str
) -> IResolvable
- Type: str
set_metadata
def set_metadata(
key: str,
value: typing.Any
) -> None
- Type: str
- Type: typing.Any
Static Functions
| Name | Description |
|---|---|
is_construct |
Return whether the given object is a Construct. |
is_construct
import ros_cdk_ecs
ros_cdk_ecs.InstanceClone.is_construct(
x: typing.Any
)
Return whether the given object is a Construct.
- Type: typing.Any
Properties
| Name | Type | Description |
|---|---|---|
node |
ros_cdk_core.ConstructNode |
The construct tree node associated with this construct. |
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 |
ros_cdk_core.IResolvable |
Attribute HostName: Host name of created instance. |
attr_inner_ip |
ros_cdk_core.IResolvable |
Attribute InnerIp: Inner IP address of the specified instance. |
attr_instance_id |
ros_cdk_core.IResolvable |
Attribute InstanceId: The instance ID of created ecs instance. |
attr_primary_network_interface_id |
ros_cdk_core.IResolvable |
Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance. |
attr_private_ip |
ros_cdk_core.IResolvable |
Attribute PrivateIp: Private IP address of created ecs instance. |
attr_public_ip |
ros_cdk_core.IResolvable |
Attribute PublicIp: Public IP address of created ecs instance. |
attr_security_group_ids |
ros_cdk_core.IResolvable |
Attribute SecurityGroupIds: Security group ID list of created instance. |
attr_zone_id |
ros_cdk_core.IResolvable |
Attribute ZoneId: Zone ID of created instance. |
nodeRequired
node: ConstructNode
- Type: ros_cdk_core.ConstructNode
The construct tree node associated with this construct.
refRequired
ref: str
- Type: str
stackRequired
stack: Stack
- Type: ros_cdk_core.Stack
The stack in which this resource is defined.
resourceOptional
resource: RosResource
- Type: ros_cdk_core.RosResource
attr_host_nameRequired
attr_host_name: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute HostName: Host name of created instance.
attr_inner_ipRequired
attr_inner_ip: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute InnerIp: Inner IP address of the specified instance.
Only for classical instance.
attr_instance_idRequired
attr_instance_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute InstanceId: The instance ID of created ecs instance.
attr_primary_network_interface_idRequired
attr_primary_network_interface_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance.
attr_private_ipRequired
attr_private_ip: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute PrivateIp: Private IP address of created ecs instance.
Only for VPC instance.
attr_public_ipRequired
attr_public_ip: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute PublicIp: Public IP address of created ecs instance.
attr_security_group_idsRequired
attr_security_group_ids: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute SecurityGroupIds: Security group ID list of created instance.
attr_zone_idRequired
attr_zone_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute ZoneId: Zone ID of created instance.