ALIYUN::MONGODB::ShardingInstance is used to create or clone an ApsaraDB for MongoDB sharded cluster instance.
Syntax
{
"Type": "ALIYUN::MONGODB::ShardingInstance",
"Properties": {
"EngineVersion": String,
"ZoneId": String,
"AutoRenew": Boolean,
"VSwitchId": String,
"Period": Integer,
"SecurityIPArray": String,
"Mongos": List,
"StorageEngine": String,
"RestoreTime": String,
"AccountPassword": String,
"VpcId": String,
"ProtocolType": String,
"ChargeType": String,
"ConfigServer": List,
"SrcDBInstanceId": String,
"ReplicaSet": List,
"Tags": List,
"TDEStatus": Boolean,
"DBInstanceDescription": String,
"ResourceGroupId": String,
"SecondaryZoneId": String,
"HiddenZoneId": String,
"StorageType": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
EngineVersion | String | No | No | The version of the database engine. | Valid values:
Note When you clone an instance, the value of this property must be the same as the database engine version of the source instance. |
ZoneId | String | No | No | The ID of the zone. | None. |
AutoRenew | Boolean | No | No | Specifies whether to enable auto-renewal for the instance. | Valid values:
Note This property takes effect when ChargeType is set to PrePaid. |
VSwitchId | String | No | No | The ID of the vSwitch. | None. |
Period | Integer | No | No | The subscription duration of the instance. | Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: month. Note You must specify this property when ChargeType is set to PrePaid. |
SecurityIPArray | String | No | No | The entries in the IP address whitelist of the instance. | Separate multiple IP addresses in the whitelist with commas (,). Each IP address must be unique in the whitelist. The whitelist can contain up to 1,000 IP addresses. You can specify entries in the whitelist in the following formats:
Note Values of % and 0.0.0.0/0 specify that the databases on the instance can be accessed from all IP addresses. This may cause security risks. Exercise caution when you use these values. |
Mongos | List | Yes | No | The mongos nodes. | You can use 2 to 32 mongos nodes. For more information, see Mongos property. |
StorageEngine | String | No | No | The storage engine that is used by the instance. | Valid values:
Note When you clone an instance, the value of this property must be the same as the storage engine of the source instance. |
RestoreTime | String | No | No | The point in time at which the cloned instance is restored. | Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can specify this property only when you clone an instance. You must specify this property together with the SrcDBInstanceId property. Note You can set this property to a point in time within the previous seven days. |
AccountPassword | String | No | Yes | The password of the root account. | The password must be 8 to 32 characters in length. It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: |
VpcId | String | No | No | The ID of the virtual private cloud (VPC). | None. |
ProtocolType | String | No | No | The type of the access protocol. | Valid values:
|
ChargeType | String | No | No | The billing method of the instance. | Valid values:
|
ConfigServer | List | Yes | No | The configurations of the Configserver node. | For more information, see ConfigServer properties. |
SrcDBInstanceId | String | No | No | The ID of the source instance. | You can specify this property only when you clone an instance. You must specify this property together with the RestoreTime property. |
ReplicaSet | List | Yes | No | The shard nodes. | You can use 2 to 32 shard nodes. For more information, see ReplicaSet properties. |
Tags | List | No | Yes | The tags. | You can add up to 20 tags. For more information, see Tags properties. |
TDEStatus | Boolean | No | Yes | Specifies whether to enable Transparent Data Encryption (TDE). | Valid values:
|
ResourceGroupId | String | No | Yes | The ID of the resource group to which the instance belongs. | None. |
DBInstanceDescription | String | No | No | The name of the instance. | The name must be 2 to 256 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter. |
SecondaryZoneId | String | No | No | The zone ID of the secondary node. | Valid values:
Note
|
HiddenZoneId | String | No | No | The zone ID of the hidden node. | Valid values:
Note
|
StorageType | String | No | No | The storage category. | Valid values:
|
Mongos syntax
"Mongos": [
{
"Class": String
}
]
Mongos property
Property | Type | Required | Editable | Description | Constraint |
Class | String | Yes | No | The instance type of the mongos node. | For more information, see Instance types. |
ConfigServer syntax
"ConfigServer": [
{
"Storage": Integer,
"Class": String
}
]
ConfigServer properties
Property | Type | Required | Editable | Description | Constraint |
Storage | Integer | Yes | No | The storage capacity of the Configserver node. | Set the value to 20. Unit: GB. Note The storage capacity is fixed as 20 GB. |
Class | String | Yes | No | The instance type of the Configserver node. | Set the value to dds.cs.mid. Note This instance type has 1 vCPU and 2 GB of memory. The number of Configserver nodes is fixed as 1. |
ReplicaSet syntax
"ReplicaSet": [
{
"Storage": Integer,
"Class": String,
"ReadonlyReplicas": Integer
}
]
ReplicaSet properties
Property | Type | Required | Editable | Description | Constraint |
Storage | Integer | Yes | No | The storage capacity of the shard node. | Valid values: 10 to 2000. Unit: GB. The value must be in increments of 10 GB. |
Class | String | Yes | No | The instance type of the shard node. | For more information, see Instance types. |
ReadonlyReplicas | Integer | No | No | The number of read-only nodes that you want to create. | Valid values: 1 to 5. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The key of the tag. | The key must be 1 to 128 characters in length, and cannot contain |
Value | String | No | No | The value of the tag. | The value can be up to 128 characters in length, and cannot contain |
Return values
Fn::GetAtt
DBInstanceStatus: the status of the instance.
DBInstanceId: the ID of the instance.
OrderId: the ID of the order.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::ZoneId
Resources:
MongoDbShardingInstance:
Type: ALIYUN::MONGODB::ShardingInstance
Properties:
ZoneId:
Ref: ZoneId
EngineVersion: '4.0'
Mongos:
- Class: dds.mongos.mid
- Class: dds.mongos.mid
ReplicaSet:
- Class: dds.shard.mid
Storage: 10
- Class: dds.shard.mid
Storage: 20
ConfigServer:
- Class: dds.cs.mid
Storage: 20
TDEStatus: false
Outputs:
DBInstanceStatus:
Description: Status of mongodb instance.
Value:
Fn::GetAtt:
- MongoDbShardingInstance
- DBInstanceStatus
DBInstanceId:
Description: The instance id of created mongodb instance.
Value:
Fn::GetAtt:
- MongoDbShardingInstance
- DBInstanceId
OrderId:
Description: Order Id of created instance.
Value:
Fn::GetAtt:
- MongoDbShardingInstance
- OrderId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"ZoneId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::ZoneId"
}
},
"Resources": {
"MongoDbShardingInstance": {
"Type": "ALIYUN::MONGODB::ShardingInstance",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"EngineVersion": "4.0",
"Mongos": [
{
"Class": "dds.mongos.mid"
},
{
"Class": "dds.mongos.mid"
}
],
"ReplicaSet": [
{
"Class": "dds.shard.mid",
"Storage": 10
},
{
"Class": "dds.shard.mid",
"Storage": 20
}
],
"ConfigServer": [
{
"Class": "dds.cs.mid",
"Storage": 20
}
],
"TDEStatus": false
}
}
},
"Outputs": {
"DBInstanceStatus": {
"Description": "Status of mongodb instance.",
"Value": {
"Fn::GetAtt": [
"MongoDbShardingInstance",
"DBInstanceStatus"
]
}
},
"DBInstanceId": {
"Description": "The instance id of created mongodb instance.",
"Value": {
"Fn::GetAtt": [
"MongoDbShardingInstance",
"DBInstanceId"
]
}
},
"OrderId": {
"Description": "Order Id of created instance.",
"Value": {
"Fn::GetAtt": [
"MongoDbShardingInstance",
"OrderId"
]
}
}
}
}
For more examples, visit sharding-instance.yml.