Skip to content

InstanceClone

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

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: Specifies whether to enable release protection for the 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.ListDiskMappingsProperty> 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: Specifies whether to enable release protection for the instance.

This parameter determines whether you can use the ECS console or call the DeleteInstance operation to release the instance. Valid values:

  • true: enables release protection for the instance.
  • false: disables release protection for the instance. Default value: false.

This parameter is applicable to only pay-as-you-go instances. It can protect instances against manual releases, but not against automatic releases.


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.ListDiskMappingsProperty>

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

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.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc 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.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • 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.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
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 java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute HostName: Host name of created instance.
attrInnerIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute InnerIp: Inner IP address of the specified instance.
attrInstanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute InstanceId: The instance ID of created ecs instance.
attrPrimaryNetworkInterfaceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance.
attrPrivateIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute PrivateIp: Private IP address of created ecs instance.
attrPublicIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute PublicIp: Public IP address of created ecs instance.
attrSecurityGroupIds java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SecurityGroupIds: Security group ID list of created instance.
attrZoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ZoneId: Zone ID of created instance.
props InstanceCloneProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.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.


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 java.lang.Object getAttrHostName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute HostName: Host name of created instance.


attrInnerIpRequired

public java.lang.Object getAttrInnerIp();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute InnerIp: Inner IP address of the specified instance.

Only for classical instance.


attrInstanceIdRequired

public java.lang.Object getAttrInstanceId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute InstanceId: The instance ID of created ecs instance.


attrPrimaryNetworkInterfaceIdRequired

public java.lang.Object getAttrPrimaryNetworkInterfaceId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute PrimaryNetworkInterfaceId: Primary network interface ID of created instance.


attrPrivateIpRequired

public java.lang.Object getAttrPrivateIp();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute PrivateIp: Private IP address of created ecs instance.

Only for VPC instance.


attrPublicIpRequired

public java.lang.Object getAttrPublicIp();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute PublicIp: Public IP address of created ecs instance.


attrSecurityGroupIdsRequired

public java.lang.Object getAttrSecurityGroupIds();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SecurityGroupIds: Security group ID list of created instance.


attrZoneIdRequired

public java.lang.Object getAttrZoneId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ZoneId: Zone ID of created instance.


propsRequired

public InstanceCloneProps getProps();