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,
"NetworkType": 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. | Default value: false. Valid values:
Note This property takes effect when the ChargeType property is set to PrePaid. |
VSwitchId | String | No | No | The ID of the vSwitch. | This property takes effect when the NetworkType property is set to VPC. |
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: months. Note This property takes effect and is required if the ChargeType property is set to PrePaid. |
SecurityIPArray | String | No | No | The IP addresses in the whitelist of the instance. | Separate multiple IP addresses with commas (,). Each IP address must be unique in the whitelist. The whitelist can contain up to 1,000 IP addresses. The following types of IP addresses are supported:
Note If you set this property to a percent sign (%) or 0.0.0.0/0, the instance can be accessed from all IP addresses. This may cause security risks to the instance. Proceed with caution. |
Mongos | List | Yes | No | The mongos nodes. | You can add 2 to 32 mongos nodes. For more information, see Mongos property. |
StorageEngine | String | No | No | The storage engine that you want to use for the instance. | Default value: WiredTiger. 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 if you clone an instance. 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 in the previous seven days. |
AccountPassword | String | No | Yes | The password of the root account. | The password must be 8 to 32 characters in length. The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include ! # $ % ^ & * () _ + - = . |
VpcId | String | No | No | The ID of the virtual private cloud (VPC). | This property takes effect when the NetworkType property is set to VPC. |
ProtocolType | String | No | No | The type of the access protocol. | Valid values:
|
ChargeType | String | No | No | The billing method of the instance. | Default value: PostPaid. Valid values:
|
NetworkType | String | No | No | The network type of the instance. | Default value: CLASSIC. 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 if you clone an instance. When you clone an instance, you must specify this property together with the RestoreTime property. |
ReplicaSet | List | Yes | No | The shard nodes. | You can add 2 to 32 shard nodes. For more information, see ReplicaSet properties. |
Tags | List | No | Yes | The tags of the instance. | 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). | Default value: false. 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 (-). The name must start with a letter. |
SecondaryZoneId | String | No | No | The ID of the zone in which the secondary node resides. | Valid values:
Note
|
HiddenZoneId | String | No | No | The ID of the zone in which the hidden node resides. | Valid values:
Note
|
StorageType | String | No | No | The storage type of the instance. | 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 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. You can scale the storage capacity 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 tag key must be 1 to 128 characters in length, and cannot contain http:// or https:// . The tag key cannot start with aliyun or acs: . |
Value | String | No | No | The value of the tag. | The tag value can be up to 128 characters in length, and cannot contain http:// or https:// . The tag value cannot start with aliyun or acs: . |
Return values
Fn::GetAtt
- DBInstanceStatus: the state of the instance.
- DBInstanceId: the ID of the instance.
- OrderId: the ID of the order.
Examples
JSON
format{ "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 ShardingInstance.json and ShardingInstance.yml.