Skip to content

Instance

This class encapsulates and extends the ROS resource type ALIYUN::Memcache::InstanceALIYUN::MEMCACHE::Instance is used to create an ApsaraDB for Memcache (OCS) instance.

Initializers

import com.aliyun.ros.cdk.memcache.Instance;
Instance.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
//  .autoRenew(java.lang.String)
//  .autoRenew(IResolvable)
//  .autoRenewPeriod(java.lang.String)
//  .autoRenewPeriod(IResolvable)
//  .autoUseCoupon(java.lang.String)
//  .autoUseCoupon(IResolvable)
//  .backupPolicy(IResolvable)
//  .backupPolicy(BackupPolicyProperty)
//  .capacity(java.lang.Number)
//  .capacity(IResolvable)
//  .chargeType(java.lang.String)
//  .chargeType(IResolvable)
//  .config(java.lang.String)
//  .config(IResolvable)
//  .couponNo(java.lang.String)
//  .couponNo(IResolvable)
//  .instanceClass(java.lang.String)
//  .instanceClass(IResolvable)
//  .instanceName(java.lang.String)
//  .instanceName(IResolvable)
//  .networkType(java.lang.String)
//  .networkType(IResolvable)
//  .password(java.lang.String)
//  .password(IResolvable)
//  .period(java.lang.String)
//  .period(IResolvable)
//  .privateIpAddress(java.lang.String)
//  .privateIpAddress(IResolvable)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .vpcId(java.lang.String)
//  .vpcId(IResolvable)
//  .vpcPasswordFree(java.lang.Boolean)
//  .vpcPasswordFree(IResolvable)
//  .vSwitchId(java.lang.String)
//  .vSwitchId(IResolvable)
//  .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.
autoRenew java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property autoRenew: Specifies whether to enable auto renewal.
autoRenewPeriod java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property autoRenewPeriod: The period of the auto renewal.
autoUseCoupon java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property autoUseCoupon: Specifies whether to use a coupon.
backupPolicy com.aliyun.ros.cdk.core.IResolvable OR BackupPolicyProperty Property backupPolicy: Backup policy.
capacity java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property capacity: The storage capacity of the instance.
chargeType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property chargeType: The billing method of the instance.
config java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property config: The parameter configuration of the instance, in a JSON string.
couponNo java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property couponNo: The coupon number.
instanceClass java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceClass: The instance type.
instanceName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceName: The name of the instance.
networkType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property networkType: The network type of the instance.
password java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property password: The password of the instance.
period java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property period: The subscription period.
privateIpAddress java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property privateIpAddress: The internal IP address of the instance.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: Resource group ID.
vpcId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property vpcId: The ID of the VPC.
vpcPasswordFree java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property vpcPasswordFree: Specifies whether to enable password free for access within the VPC.
vSwitchId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property vSwitchId: The ID of the VSwitch.
zoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property zoneId: The ID of the zone in which the instance is created.

scopeRequired

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

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

autoRenewOptional

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

Property autoRenew: Specifies whether to enable auto renewal.

Valid values: true false Note Default value: false.


autoRenewPeriodOptional

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

Property autoRenewPeriod: The period of the auto renewal.

Unit: months. Valid values: 1 2 3 6 12 Note You must specify this parameter if the value of the AutoRenew parameter is true.


autoUseCouponOptional

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

Property autoUseCoupon: Specifies whether to use a coupon.

Valid values: true false Note Default value: false.


backupPolicyOptional

Property backupPolicy: Backup policy.


capacityOptional

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

Property capacity: The storage capacity of the instance.

Unit: MB. Note You need to pass at least one of the Capacity and InstanceClass parameters when calling the CreateInstance operation.


chargeTypeOptional

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

Property chargeType: The billing method of the instance.

Valid values: PrePaid: subscription. PostPaid: pay-as-you-go. Note Default value: PostPaid.


configOptional

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

Property config: The parameter configuration of the instance, in a JSON string.

For more information, see Set parameters.


couponNoOptional

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

Property couponNo: The coupon number.

Default value: youhuiquan_promotion_option_id_for_blank.


instanceClassOptional

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

Property instanceClass: The instance type.

For more information, see Instance types. Note You need to pass at least one of the Capacity and InstanceClass parameters when calling the CreateInstance operation.


instanceNameOptional

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

Property instanceName: The name of the instance.

The name can be 2 to 128 characters in length and must start with a letter. The following characters are not supported: at signs (@), forward slashes (/), colons (:), equal signs (=), double quotation marks ("), angle brackets (<>), braces ([]), curly brackets ({}) and spaces.


networkTypeOptional

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

Property networkType: The network type of the instance.

Valid values: CLASSIC VPC Note Default value: CLASSIC.


passwordOptional

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

Property password: The password of the instance.

The password can be 8 to 32 characters in length and must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. Special characters include ! at signs (@), number signs (#), dollar signs ($), percent signs (%), carets (^), ampersands (&), asterisks (*), parentheses (()), underscores (_), plus signs (+), hyphens (-), and equal signs (=).


periodOptional

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

Property period: The subscription period.

You must specify this parameter if the value of the ChargeType parameter is PrePaid. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Note This parameter is invalid if the value of the ChargeType parameter is PostPaid.


privateIpAddressOptional

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

Property privateIpAddress: The internal IP address of the instance.

Note The internal IP address must be located in the Classless Inter-Domain Routing (CIDR) block of the VSwitch to which the instance belongs.


resourceGroupIdOptional

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

Property resourceGroupId: Resource group ID.


vpcIdOptional

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

Property vpcId: The ID of the VPC.


vpcPasswordFreeOptional

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

Property vpcPasswordFree: Specifies whether to enable password free for access within the VPC.

If set to:

  • true: enables password free.
  • false: disables password free.

vSwitchIdOptional

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

Property vSwitchId: The ID of the VSwitch.


zoneIdOptional

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

Property zoneId: The ID of the zone in which the instance is created.

You can call the DescribeRegions operation to query the latest region list.


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.

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

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.memcache.Instance;
Instance.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.
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.
attrConnectionDomain com.aliyun.ros.cdk.core.IResolvable Attribute ConnectionDomain: The internal endpoint of the instance.
attrInstanceId com.aliyun.ros.cdk.core.IResolvable Attribute InstanceId: The globally unique identifier (GUID) of the instance.
attrInstanceName com.aliyun.ros.cdk.core.IResolvable Attribute InstanceName: The name of the instance.
attrPort com.aliyun.ros.cdk.core.IResolvable Attribute Port: Port of created instance.
attrQps com.aliyun.ros.cdk.core.IResolvable Attribute QPS: QPS.

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

attrConnectionDomainRequired

public IResolvable getAttrConnectionDomain();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ConnectionDomain: The internal endpoint of the instance.


attrInstanceIdRequired

public IResolvable getAttrInstanceId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute InstanceId: The globally unique identifier (GUID) of the instance.


attrInstanceNameRequired

public IResolvable getAttrInstanceName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute InstanceName: The name of the instance.


attrPortRequired

public IResolvable getAttrPort();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Port: Port of created instance.


attrQpsRequired

public IResolvable getAttrQps();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute QPS: QPS.