Creates or clones a MongoDB replica set instance.
Syntax
{
"Type": "ALIYUN::MONGODB::Instance",
"Properties": {
"DatabaseNames": String,
"VpcPasswordFree": Boolean,
"ReadonlyReplicas": Integer,
"BusinessInfo": String,
"AccountPassword": String,
"VpcId": String,
"SecurityGroupId": String,
"AutoRenew": Boolean,
"ResourceGroupId": String,
"VSwitchId": String,
"StorageEngine": String,
"SrcDBInstanceId": String,
"ReplicationFactor": Integer,
"ZoneId": String,
"EngineVersion": String,
"RestoreTime": String,
"DBInstanceStorage": Integer,
"DBInstanceDescription": String,
"CouponNo": String,
"Period": Integer,
"SecurityIPArray": String,
"ChargeType": String,
"BackupId": String,
"TDEStatus": Boolean,
"DBInstanceClass": String,
"Tags": List,
"SecondaryZoneId": String,
"HiddenZoneId": String,
"StorageType": String,
"PrivateConnections": Map,
"ClusterId": String,
"SrcRegion": String,
"AuditPolicyOptions": Map,
"DBInstanceReleaseProtection": Boolean,
"SSLOptions": Map,
"Encrypted": Boolean,
"ProvisionedIops": Integer,
"EncryptionKey": String,
"RestoreType": Integer,
"BackupPolicyOptions": Map
}
}
Properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
DBInstanceStorage |
Integer |
Yes |
Yes |
The storage capacity. |
Valid values: 10 to 3000. The value must be a multiple of 10. Unit: GB. |
|
DBInstanceClass |
String |
Yes |
Yes |
The instance type. |
|
|
TDEStatus |
Boolean |
No |
Yes |
Enables Transparent Data Encryption (TDE). |
Valid values:
|
|
SrcDBInstanceId |
String |
No |
No |
The ID of the source instance. |
Required for cloning. Use with BackupId or RestoreTime. |
|
DBInstanceDescription |
String |
No |
No |
The description of the instance. |
2-256 characters. Must start with a letter or Chinese character. Allows letters, digits, Chinese characters, underscores (_), and hyphens (-). |
|
SecurityIPArray |
String |
No |
Yes |
The IP address whitelist. |
Separate with commas (,). Each address must be unique. Maximum: 1,000. Formats: 0.0.0.0/0, 10.23.XX.XX (IP address), or 10.23.XX.XX/24 (CIDR block, prefix length 1-32). Default: 0.0.0.0/0 (all IP addresses). |
|
ClusterId |
String |
No |
No |
The ID of the dedicated cluster. |
None |
|
SrcRegion |
String |
No |
No |
The region of the source instance. |
Note
|
|
AuditPolicyOptions |
Map |
No |
Yes |
The audit policy configuration. |
|
|
DBInstanceReleaseProtection |
Boolean |
No |
Yes |
Enables release protection. |
Valid values:
|
|
SSLOptions |
Map |
No |
Yes |
The TLS/SSL encryption configuration. |
|
|
Encrypted |
Boolean |
No |
No |
Enables disk encryption. |
None |
|
ProvisionedIops |
Integer |
No |
No |
The provisioned performance. |
None |
|
EncryptionKey |
String |
No |
No |
The KMS key for disk encryption. |
None |
|
RestoreType |
Integer |
No |
No |
The instance restore type. |
Valid values:
|
|
BackupPolicyOptions |
Map |
No |
Yes |
The backup policy configuration. |
|
|
ZoneId |
String |
No |
No |
The ID of the zone. |
For more information, see DescribeRegions. If the instance is in a VPC, the value of this parameter must be the same as the zone of the vSwitch. |
|
VpcPasswordFree |
Boolean |
No |
No |
Enables passwordless access over a VPC. |
Valid values:
|
|
VpcId |
String |
No |
No |
The ID of the VPC. |
None |
|
SecurityGroupId |
String |
No |
Yes |
The ID of the security group. |
None |
|
VSwitchId |
String |
No |
No |
The ID of the vSwitch. |
None |
|
BackupId |
String |
No |
No |
The ID of the backup set. |
Required for cloning. Use with SrcDBInstanceId. |
|
AccountPassword |
String |
No |
Yes |
The password of the root account. |
6-32 characters. Allows letters, digits, and these special characters: |
|
EngineVersion |
String |
No |
No |
The database engine version. |
Valid values:
|
|
StorageEngine |
String |
No |
No |
The storage engine. |
Valid values:
|
|
ReplicationFactor |
Integer |
No |
Yes |
The number of nodes in the replica set. |
Valid values:
|
|
DatabaseNames |
String |
No |
No |
The name of the database. |
None |
|
ReadonlyReplicas |
Integer |
No |
Yes |
The number of read-only nodes. |
Valid values: 1 to 5. |
|
BusinessInfo |
String |
No |
No |
The business information. |
This is an additional parameter. |
|
ResourceGroupId |
String |
No |
Yes |
The ID of the resource group. |
None |
|
AutoRenew |
Boolean |
No |
No |
Enables auto-renewal. |
Valid values:
|
|
RestoreTime |
String |
No |
No |
The restore point for cloning. |
Format: yyyy-MM-ddTHH:mm:ssZ (UTC). Required for cloning. Use with SrcDBInstanceId and BackupId. Supports restore points within the last 7 days. |
|
CouponNo |
String |
No |
No |
The coupon code. |
Default: youhuiquan_promotion_option_id_for_blank. |
|
Period |
Integer |
No |
Yes |
The subscription duration. |
Unit: month. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. The default value is 1. Applies only when ChargeType is PrePaid. |
|
ChargeType |
String |
No |
Yes |
The billing method. |
Valid values:
|
|
Tags |
List |
No |
Yes |
The tags. |
You can add up to 20 tags. |
|
SecondaryZoneId |
String |
No |
No |
The zone where the secondary node is deployed. |
Valid values:
Note
|
|
HiddenZoneId |
String |
No |
No |
The zone where the hidden node is deployed. |
Valid values:
Note
|
|
StorageType |
String |
No |
No |
The storage class. |
Valid values:
|
|
PrivateConnections |
Map |
No |
Yes |
The configurations of the private connection. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
Key |
String |
Yes |
No |
The tag key. |
The key must be 1 to 128 characters in length. It cannot start with |
|
Value |
String |
No |
No |
The tag value. |
The value must be 0 to 128 characters in length. It cannot start with |
PrivateConnections syntax
"PrivateConnections":
{
"ReplicaConnections": List
}
PrivateConnections properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
ReplicaConnections |
List |
Yes |
Yes |
The connection information of the replica nodes. |
Length: 1-6. Note
You can create or modify the connection information of a node only in the same order as the connection information is queried by calling the DescribeDBInstanceAttribute operation. |
AuditPolicyOptions syntax
"AuditPolicyOptions":
{
"StoragePeriod": Integer,
"AuditStatus": String,
"AuditLogSwitchSource": String,
"ServiceType": String
}
AuditPolicyOptions properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
AuditStatus |
String |
Yes |
Yes |
The status of the audit log. |
Valid values:
|
|
StoragePeriod |
Integer |
No |
Yes |
The retention period of audit logs. |
Valid values: 1 to 365. The default value is 30. Unit: days. |
|
AuditLogSwitchSource |
String |
No |
Yes |
The source of the audit log request. |
The value is Console. |
|
ServiceType |
String |
No |
Yes |
The audit log version. |
Valid values:
Note
Default: Trial. Since January 6, 2022, the official edition is available in various regions and the free trial is no longer offered. Set this to Standard. |
SSLOptions syntax
"SSLOptions":
{
"ForceEncryption": Integer,
"SwitchMode": Integer,
"SSLAction": String
}
SSLOptions properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
SSLAction |
String |
Yes |
Yes |
The operation to perform on the SSL feature. |
Valid values:
|
|
ForceEncryption |
Integer |
No |
Yes |
Enables forced SSL encryption for connections. |
Valid values:
|
|
SwitchMode |
Integer |
No |
Yes |
When to apply SSL configuration changes. |
Valid values:
|
BackupPolicyOptions syntax
"SSLOptions":
{
"CrossBackupType": String,
"BackupInterval": Integer,
"BackupRetentionPolicyOnClusterDeletion": Integer,
"HighFrequencyBackupRetention": Integer,
"BackupRetentionPeriod": Integer,
"InstanceType": String,
"LogBackupRetentionPeriod": Integer,
"CrossRetentionValue": Integer,
"CrossBackupPeriod": String,
"PreferredBackupTime": String,
"DestRegion": String,
"CrossRetentionType": String,
"EnableCrossLogBackup": Integer,
"PreferredBackupPeriod": String,
"PreserveOneEachHour": Boolean,
"SnapshotBackupType": String,
"CrossLogRetentionType": String,
"CrossLogRetentionValue": Integer,
"EnableBackupLog": Integer,
"SrcRegion": String
}
BackupPolicyOptions properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
CrossBackupType |
String |
No |
Yes |
The geo-redundancy policy. |
Valid values:
|
|
BackupInterval |
Integer |
No |
Yes |
The high-frequency backup frequency. |
Valid values:
|
|
BackupRetentionPolicyOnClusterDeletion |
Integer |
No |
Yes |
Backup retention policy. |
Valid values:
|
|
HighFrequencyBackupRetention |
Integer |
No |
Yes |
The retention period of high-frequency backups. |
Before you use this parameter, make sure that the BackupInterval parameter is specified. The default retention period is one day. Unit: days. |
|
BackupRetentionPeriod |
Integer |
No |
Yes |
The retention period of full backups. |
Note
|
|
InstanceType |
String |
No |
Yes |
The instance type. |
Valid values:
Note
|
|
LogBackupRetentionPeriod |
Integer |
No |
Yes |
The retention period of log backups. |
The default value is 7. Valid values: 7 to 730. Unit: days. |
|
CrossRetentionValue |
Integer |
No |
Yes |
The retention period of geo-redundant backups. |
Valid values: 3 to 1825. Unit: days. Note
|
|
CrossBackupPeriod |
String |
No |
Yes |
Geo-redundancy retention period |
Valid values:
Note
This parameter is required for geo-redundant backups.
|
|
PreferredBackupTime |
String |
No |
Yes |
The time to perform a backup. |
Specify the time in the HH:mmZ-HH:mmZ format. The time must be in UTC. Note
The time range must be 1 hour. |
|
DestRegion |
String |
No |
Yes |
The region where the backup is stored. |
Note
This parameter is required for geo-redundant backups. |
|
CrossRetentionType |
String |
No |
Yes |
The retention policy for geo-redundant backups. |
Note
|
|
EnableCrossLogBackup |
Integer |
No |
Yes |
Enables cross-region log backup. |
Note
This parameter is required for geo-redundant backups.
|
|
PreferredBackupPeriod |
String |
No |
Yes |
The backup cycle. |
Valid values:
Note
Separate multiple values with commas (,). |
|
PreserveOneEachHour |
Boolean |
No |
Yes |
Enables hourly sparse backup. |
Valid values:
|
|
SnapshotBackupType |
String |
No |
Yes |
The snapshot backup type. |
Valid values:
|
|
CrossLogRetentionType |
String |
No |
Yes |
The retention policy for cross-region log backups. |
Valid values:
|
|
CrossLogRetentionValue |
Integer |
No |
Yes |
The retention period of cross-region log backups. |
Valid values: 3 to 1825. The value must be less than or equal to the value of CrossRetentionValue. Unit: days. |
|
EnableBackupLog |
Integer |
No |
Yes |
Enables log backup. |
Valid values:
|
|
SrcRegion |
String |
No |
Yes |
The region of the instance. |
Note
|
ReplicaConnections syntax
{
"PrivateConnections": {
"ReplicaConnections": [
{
"ConnectionString": String,
"ConnectionPort": Integer
}
]
}
}
ReplicaConnections properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
ConnectionString |
String |
Yes |
Yes |
The connection address prefix |
The prefix must start with a lowercase letter and end with a lowercase letter or a digit. It must consist of lowercase letters, digits, and hyphens (-). It must be 8 to 63 characters in length. Note
Specify only the prefix of the endpoint. The rest of the endpoint cannot be modified. You can modify the endpoints of primary, secondary, and read-only nodes for instances that use local SSDs or ESSDs. |
|
ConnectionPort |
Integer |
No |
Yes |
The connection port. |
Valid values: 1000 to 65535. Note
You can modify the port only for an instance that runs MongoDB 4.2 or later and uses ESSDs. |
Return values
Fn::GetAtt
-
OrderId: The ID of the order used to create the MongoDB instance.
-
DBInstanceId: The ID of the MongoDB instance. The ID is globally unique.
-
DBInstanceStatus: The status of the MongoDB instance.
-
ConnectionURI: The connection URI.
-
ReplicaSetName: The name of the replica set.
-
Arn: The Alibaba Cloud Resource Name (ARN) of the instance.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Description: Test MONGODB Instance
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::ZoneId
VSwitchId:
Type: String
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
VpcId: ${VpcId}
Resources:
MongoDB:
Type: ALIYUN::MONGODB::Instance
Properties:
DBInstanceClass: dds.mongo.mid
DBInstanceStorage: 10
ZoneId:
Ref: ZoneId
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
Outputs: {}{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "Test MONGODB Instance",
"Parameters": {
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"ZoneId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::ZoneId"
},
"VSwitchId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"ZoneId": "${ZoneId}",
"VpcId": "${VpcId}"
}
}
},
"Resources": {
"MongoDB": {
"Type": "ALIYUN::MONGODB::Instance",
"Properties": {
"DBInstanceClass": "dds.mongo.mid",
"DBInstanceStorage": 10,
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
}
}
}
},
"Outputs": {
}
}