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 com.aliyun.ros.cdk.ecs.InstanceClone;
InstanceClone.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.sourceInstanceId(java.lang.String)
.sourceInstanceId(IResolvable)
// .backendServerWeight(java.lang.Number)
// .backendServerWeight(IResolvable)
// .deletionProtection(java.lang.Boolean)
// .deletionProtection(IResolvable)
// .description(java.lang.String)
// .description(IResolvable)
// .diskMappings(IResolvable)
// .diskMappings(java.util.List<IResolvable)
// .diskMappings(DiskMappingsProperty>)
// .imageId(java.lang.String)
// .imageId(IResolvable)
// .instanceChargeType(java.lang.String)
// .instanceChargeType(IResolvable)
// .instanceName(java.lang.String)
// .instanceName(IResolvable)
// .internetMaxBandwidthIn(java.lang.Number)
// .internetMaxBandwidthIn(IResolvable)
// .keyPairName(java.lang.String)
// .keyPairName(IResolvable)
// .loadBalancerIdToAttach(java.lang.String)
// .loadBalancerIdToAttach(IResolvable)
// .password(java.lang.String)
// .password(IResolvable)
// .period(java.lang.Number)
// .period(IResolvable)
// .ramRoleName(java.lang.String)
// .ramRoleName(IResolvable)
// .resourceGroupId(java.lang.String)
// .resourceGroupId(IResolvable)
// .securityGroupId(java.lang.String)
// .securityGroupId(IResolvable)
// .spotPriceLimit(java.lang.String)
// .spotPriceLimit(IResolvable)
// .spotStrategy(java.lang.String)
// .spotStrategy(IResolvable)
// .tags(java.util.List<TagsProperty>)
// .zoneId(java.lang.String)
// .zoneId(IResolvable)
.build();
| Name | Type | Description |
|---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
No description. |
id |
java.lang.String |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
sourceInstanceId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property sourceInstanceId: Source ecs instance used to copy properties to clone new ecs instance. |
backendServerWeight |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property backendServerWeight: The weight of backend server of load balancer. |
deletionProtection |
java.lang.Boolean OR com.aliyun.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 |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property description: Description of the instance, [2, 256] characters. |
diskMappings |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property diskMappings: Disk mappings to attach to instance. |
imageId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property imageId: Image ID to create ecs instance. |
instanceChargeType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property instanceChargeType: Instance Charge type, allowed value: Prepaid and Postpaid. |
instanceName |
java.lang.String OR com.aliyun.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 '.', '-'. |
internetMaxBandwidthIn |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property internetMaxBandwidthIn: Max internet out band width setting, unit in Mbps(Mega bit per second). |
keyPairName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property keyPairName: SSH key pair name. |
loadBalancerIdToAttach |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property loadBalancerIdToAttach: After the instance is created. |
password |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property password: Password of created ecs instance. |
period |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property period: Prepaid time period. |
ramRoleName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property ramRoleName: Instance RAM role name. |
resourceGroupId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property resourceGroupId: Resource group id. |
securityGroupId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property securityGroupId: Security group to create ecs instance. |
spotPriceLimit |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property spotPriceLimit: The hourly price threshold of a instance, and it takes effect only when parameter InstanceChargeType is PostPaid. |
spotStrategy |
java.lang.String OR com.aliyun.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 |
java.util.List<TagsProperty> |
Property tags: Tags to attach to instance. |
zoneId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property zoneId: The ID of the zone to which the instance belongs. |
scopeRequired
- Type: com.aliyun.ros.cdk.core.Construct
idRequired
- Type: java.lang.String
enableResourcePropertyConstraintOptional
- Type: java.lang.Boolean
sourceInstanceIdRequired
- Type: java.lang.String OR com.aliyun.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.
backendServerWeightOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property backendServerWeight: The weight of backend server of load balancer.
From 0 to 100, 0 means offline. Default is 100.
deletionProtectionOptional
- Type: java.lang.Boolean OR com.aliyun.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: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property description: Description of the instance, [2, 256] characters.
Do not fill or empty, the default is empty.
diskMappingsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
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.
imageIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property imageId: Image ID to create ecs instance.
instanceChargeTypeOptional
- Type: java.lang.String OR com.aliyun.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.
instanceNameOptional
- Type: java.lang.String OR com.aliyun.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 '.', '-'.
internetMaxBandwidthInOptional
- Type: java.lang.Number OR com.aliyun.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.
keyPairNameOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property keyPairName: SSH key pair name.
loadBalancerIdToAttachOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property loadBalancerIdToAttach: After the instance is created.
Automatic attach it to the load balancer.
passwordOptional
- Type: java.lang.String OR com.aliyun.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: java.lang.Number OR com.aliyun.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.
ramRoleNameOptional
- Type: java.lang.String OR com.aliyun.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.
resourceGroupIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resourceGroupId: Resource group id.
securityGroupIdOptional
- Type: java.lang.String OR com.aliyun.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.
spotPriceLimitOptional
- Type: java.lang.String OR com.aliyun.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.
spotStrategyOptional
- Type: java.lang.String OR com.aliyun.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: java.util.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.
zoneIdOptional
- Type: java.lang.String OR com.aliyun.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.
Methods
| Name | Description |
|---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition |
No description. |
addCount |
No description. |
addDependency |
No description. |
addResourceDesc |
No description. |
applyRemovalPolicy |
No description. |
getAtt |
No description. |
setMetadata |
No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
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: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
| Name | Description |
|---|---|
isConstruct |
Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.ecs.InstanceClone;
InstanceClone.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
| Name | Type | Description |
|---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
ref |
java.lang.String |
No description. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this resource is defined. |
resource |
com.aliyun.ros.cdk.core.RosResource |
No description. |
attrHostName |
com.aliyun.ros.cdk.core.IResolvable |
Attribute HostName: Host name of created instance. |
attrInnerIp |
com.aliyun.ros.cdk.core.IResolvable |
Attribute InnerIp: Inner IP address of the specified instance. |
attrInstanceId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute InstanceId: The instance ID of created ecs instance. |
attrPrimaryNetworkInterfaceId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance. |
attrPrivateIp |
com.aliyun.ros.cdk.core.IResolvable |
Attribute PrivateIp: Private IP address of created ecs instance. |
attrPublicIp |
com.aliyun.ros.cdk.core.IResolvable |
Attribute PublicIp: Public IP address of created ecs instance. |
attrSecurityGroupIds |
com.aliyun.ros.cdk.core.IResolvable |
Attribute SecurityGroupIds: Security group ID list of created instance. |
attrZoneId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute ZoneId: Zone ID of created instance. |
nodeRequired
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
refRequired
public java.lang.String getRef();
- Type: java.lang.String
stackRequired
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resourceOptional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrHostNameRequired
public IResolvable getAttrHostName();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute HostName: Host name of created instance.
attrInnerIpRequired
public IResolvable getAttrInnerIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InnerIp: Inner IP address of the specified instance.
Only for classical instance.
attrInstanceIdRequired
public IResolvable getAttrInstanceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InstanceId: The instance ID of created ecs instance.
attrPrimaryNetworkInterfaceIdRequired
public IResolvable getAttrPrimaryNetworkInterfaceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance.
attrPrivateIpRequired
public IResolvable getAttrPrivateIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PrivateIp: Private IP address of created ecs instance.
Only for VPC instance.
attrPublicIpRequired
public IResolvable getAttrPublicIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PublicIp: Public IP address of created ecs instance.
attrSecurityGroupIdsRequired
public IResolvable getAttrSecurityGroupIds();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute SecurityGroupIds: Security group ID list of created instance.
attrZoneIdRequired
public IResolvable getAttrZoneId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ZoneId: Zone ID of created instance.