ShardingInstance
- Implements: IShardingInstance
This class encapsulates and extends the ROS resource type ALIYUN::MONGODB::ShardingInstance.
Initializers
import com.aliyun.ros.cdk.mongodb.ShardingInstance;
ShardingInstance.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.configServer(IResolvable)
.configServer(java.util.List<IResolvable)
.configServer(ConfigServerProperty>)
.mongos(IResolvable)
.mongos(java.util.List<IResolvable)
.mongos(MongosProperty>)
.replicaSet(IResolvable)
.replicaSet(java.util.List<IResolvable)
.replicaSet(ReplicaSetProperty>)
// .accountPassword(java.lang.String)
// .accountPassword(IResolvable)
// .autoRenew(java.lang.Boolean)
// .autoRenew(IResolvable)
// .chargeType(java.lang.String)
// .chargeType(IResolvable)
// .dbInstanceDescription(java.lang.String)
// .dbInstanceDescription(IResolvable)
// .engineVersion(java.lang.String)
// .engineVersion(IResolvable)
// .hiddenZoneId(java.lang.String)
// .hiddenZoneId(IResolvable)
// .period(java.lang.Number)
// .period(IResolvable)
// .protocolType(java.lang.String)
// .protocolType(IResolvable)
// .resourceGroupId(java.lang.String)
// .resourceGroupId(IResolvable)
// .restoreTime(java.lang.String)
// .restoreTime(IResolvable)
// .secondaryZoneId(java.lang.String)
// .secondaryZoneId(IResolvable)
// .securityIpArray(java.lang.String)
// .securityIpArray(IResolvable)
// .srcDbInstanceId(java.lang.String)
// .srcDbInstanceId(IResolvable)
// .storageEngine(java.lang.String)
// .storageEngine(IResolvable)
// .storageType(java.lang.String)
// .storageType(IResolvable)
// .tags(java.util.List<TagsProperty>)
// .tdeStatus(java.lang.Boolean)
// .tdeStatus(IResolvable)
// .vpcId(java.lang.String)
// .vpcId(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. |
configServer | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property configServer: The information of Configserver nodes. |
mongos | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property mongos: The information of Mongos nodes. |
replicaSet | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property replicaSet: The information of shard nodes. |
accountPassword | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property accountPassword: The password of the root account. |
autoRenew | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property autoRenew: Specifies whether to enable auto-renewal for the instance. |
chargeType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property chargeType: The billing method of the instance.values:PostPaid: Pay-As-You-Go.PrePaid: Subscription.Default value: PostPaid. |
dbInstanceDescription | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property dbInstanceDescription: The name of the instance. |
engineVersion | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property engineVersion: The database version. |
hiddenZoneId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property hiddenZoneId: Configure the zone where the hidden node resides to implement multi-availability zone deployment. |
period | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property period: The subscription duration of the instance. |
protocolType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property protocolType: Protocol type. |
resourceGroupId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property resourceGroupId: The ID of the resource group. |
restoreTime | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property restoreTime: The time to restore the cloned instance to. |
secondaryZoneId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property secondaryZoneId: Configure the zone where the secondary node resides to implement multi-availability zone deployment. |
securityIpArray | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property securityIpArray: Security ips to add or remove. |
srcDbInstanceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property srcDbInstanceId: The source instance ID. |
storageEngine | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property storageEngine: Database storage engine.Support WiredTiger, RocksDB, TerarkDB. |
storageType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property storageType: The storage type of the instance. |
tags | java.util.List<TagsProperty> | Property tags: Tags to attach to instance. |
tdeStatus | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property tdeStatus: Specifies whether to enable Transparent Data Encryption (TDE). |
vpcId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property vpcId: The VPC id to create mongodb instance. |
vSwitchId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property vSwitchId: The vSwitch Id to create mongodb instance. |
zoneId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property zoneId: On which zone to create the instance. |
scopeRequired
- Type: com.aliyun.ros.cdk.core.Construct
idRequired
- Type: java.lang.String
enableResourcePropertyConstraintOptional
- Type: java.lang.Boolean
configServerRequired
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ConfigServerProperty>
Property configServer: The information of Configserver nodes.
mongosRequired
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
MongosProperty>
Property mongos: The information of Mongos nodes.
replicaSetRequired
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ReplicaSetProperty>
Property replicaSet: The information of shard nodes.
accountPasswordOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property accountPassword: The password of the root account.
The password must meet the following requirements:
- It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
- Special characters include !@#$%^&*()_+-=
- It must be 8 to 32 characters in length.
autoRenewOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property autoRenew: Specifies whether to enable auto-renewal for the instance.
Valid values:
- true: Auto-renewal is enabled.
- false: Auto-renewal is disabled. You must manually renew the instance. This is the default value.
This parameter is optional and takes effect only when you set the ChargeType parameter to PrePaid.
chargeTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property chargeType: The billing method of the instance.values:PostPaid: Pay-As-You-Go.PrePaid: Subscription.Default value: PostPaid.
dbInstanceDescriptionOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property dbInstanceDescription: The name of the instance.
The name must meet the following requirements:
- It must start with a Chinese character or a letter.
- It can contain digits, Chinese characters, letters, underscores (_), periods (.), and hyphens (-).
- It must be 2 to 256 characters in length.
engineVersionOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property engineVersion: The database version.
Valid values:
- 8.0
- 7.0
- 6.0
- 5.0
- 4.4
- 4.2
- 4.0
- When you clone an instance by calling this operation, the value of this parameter must be the same as that of the source instance.
hiddenZoneIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property hiddenZoneId: Configure the zone where the hidden node resides to implement multi-availability zone deployment.
When the value of the EngineVersion is 4.4 and later, this parameter is available and required. The value of this parameter cannot be the same as that of ZoneId and SecondaryZoneId.
periodOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property period: The subscription duration of the instance.
Unit: month. Valid values: 1 to 9 (integer), 12, 24, 36, and 60.
This parameter is required and takes effect only when you set the ChargeType parameter to PrePaid.
protocolTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property protocolType: Protocol type.
Valid value: mongodb or dynamodb.
resourceGroupIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resourceGroupId: The ID of the resource group.
restoreTimeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property restoreTime: The time to restore the cloned instance to.
The format is yyyy-MM-ddTHH:mm:ssZ.This parameter can only be specified when this operation is called to clone instances.You must also specify theSrcDBInstanceIdparameter and theBackupIdparameter.You can clone instances to any restore time in the past seven days.
secondaryZoneIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property secondaryZoneId: Configure the zone where the secondary node resides to implement multi-availability zone deployment.
When the value of the EngineVersion is 4.4 and later, this parameter is available and required.The value of this parameter cannot be the same as that of ZoneId and HiddenZoneId.
securityIpArrayOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property securityIpArray: Security ips to add or remove.
Update to this property will cover the current security ips.
srcDbInstanceIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property srcDbInstanceId: The source instance ID.
This parameter is required only when you clone an instance by calling this operation. You must also specify the RestoreTime parameter.
storageEngineOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property storageEngine: Database storage engine.Support WiredTiger, RocksDB, TerarkDB.
storageTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property storageType: The storage type of the instance.
Instances of MongoDB 4.4 and later only support cloud disks. cloud_essd1 is selected if you leave this parameter empty. Instances of MongoDB 4.2 and earlier support only local disks. local_ssd is selected if you leave this parameter empty.
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.
tdeStatusOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property tdeStatus: Specifies whether to enable Transparent Data Encryption (TDE).
Valid values: true: enable TDE false: disable TDE (default) Note: You cannot disable TDE after it is enabled.
vpcIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property vpcId: The VPC id to create mongodb instance.
vSwitchIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property vSwitchId: The vSwitch Id to create mongodb instance.
zoneIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property zoneId: On which zone to create the instance.
If VpcId and VSwitchId is specified, ZoneId is required and VSwitch should be in same zone.
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.
- 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
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)
- 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.mongodb.ShardingInstance;
ShardingInstance.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. |
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. |
attrArn | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Arn: The Alibaba Cloud Resource Name (ARN). |
attrDbInstanceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute DBInstanceId: The instance id of created mongodb instance. |
attrDbInstanceStatus | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute DBInstanceStatus: Status of mongodb instance. |
attrOrderId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute OrderId: Order Id of created instance. |
props | ShardingInstanceProps | 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
attrArnRequired
public java.lang.Object getAttrArn();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Arn: The Alibaba Cloud Resource Name (ARN).
attrDbInstanceIdRequired
public java.lang.Object getAttrDbInstanceId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute DBInstanceId: The instance id of created mongodb instance.
attrDbInstanceStatusRequired
public java.lang.Object getAttrDbInstanceStatus();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute DBInstanceStatus: Status of mongodb instance.
attrOrderIdRequired
public java.lang.Object getAttrOrderId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute OrderId: Order Id of created instance.
propsRequired
public ShardingInstanceProps getProps();
- Type: ShardingInstanceProps