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. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
sourceInstanceId
Required
- 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.
backendServerWeight
Optional
- 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.
deletionProtection
Optional
- 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.
description
Optional
- 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.
diskMappings
Optional
- 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.
imageId
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property imageId: Image ID to create ecs instance.
instanceChargeType
Optional
- 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.
instanceName
Optional
- 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 '.', '-'.
internetMaxBandwidthIn
Optional
- 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.
keyPairName
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property keyPairName: SSH key pair name.
loadBalancerIdToAttach
Optional
- 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.
password
Optional
- 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.
period
Optional
- 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.
ramRoleName
Optional
- 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.
resourceGroupId
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resourceGroupId: Resource group id.
securityGroupId
Optional
- 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.
spotPriceLimit
Optional
- 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.
spotStrategy
Optional
- 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.
tags
Optional
- 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.
zoneId
Optional
- 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. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrHostName
Required
public IResolvable getAttrHostName();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute HostName: Host name of created instance.
attrInnerIp
Required
public IResolvable getAttrInnerIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InnerIp: Inner IP address of the specified instance.
Only for classical instance.
attrInstanceId
Required
public IResolvable getAttrInstanceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InstanceId: The instance ID of created ecs instance.
attrPrimaryNetworkInterfaceId
Required
public IResolvable getAttrPrimaryNetworkInterfaceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance.
attrPrivateIp
Required
public IResolvable getAttrPrivateIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PrivateIp: Private IP address of created ecs instance.
Only for VPC instance.
attrPublicIp
Required
public IResolvable getAttrPublicIp();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute PublicIp: Public IP address of created ecs instance.
attrSecurityGroupIds
Required
public IResolvable getAttrSecurityGroupIds();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute SecurityGroupIds: Security group ID list of created instance.
attrZoneId
Required
public IResolvable getAttrZoneId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ZoneId: Zone ID of created instance.