The ALIYUN::MONGODB::Instance type 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 space of the database instance. | Valid values: 10 to 3000. The value must be a multiple of 10. Unit: GB. |
DBInstanceClass | String | Yes | Yes | The instance type. | For more information, see Instance types. |
TDEStatus | Boolean | No | Yes | Specifies whether to enable Transparent Data Encryption (TDE). | Valid values:
|
SrcDBInstanceId | String | No | No | The ID of the source instance. | This parameter is specified only when you clone an instance. It must be specified with the BackupId or RestoreTime parameter. |
DBInstanceDescription | String | No | No | The description of the instance. | The description must be 2 to 256 characters in length. It must start with a Chinese character or a letter and can contain Chinese characters, letters, digits, underscores (_), and hyphens (-). |
SecurityIPArray | String | No | Yes | The IP addresses in the whitelist that can access the instance. | Separate multiple IP addresses with commas (,). Each IP address must be unique. You can specify up to 1,000 IP addresses. Supported formats are 0.0.0.0/0, 10.23.XX.XX (an IP address), or 10.23.XX.XX/24 (a CIDR block). In a CIDR block, /24 indicates that the prefix is 24 bits in length. The prefix length can range from 1 to 32. The default value is 0.0.0.0/0, which indicates that all IP addresses can access the instance. |
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. | For more information, see the AuditPolicyOptions properties section. |
DBInstanceReleaseProtection | Boolean | No | Yes | Specifies whether to enable release protection for the instance. | Valid values:
|
SSLOptions | Map | No | Yes | The Transport Layer Security (TLS) and Secure Sockets Layer (SSL) encryption configuration. | For more information, see the SSLOptions properties section. |
Encrypted | Boolean | No | No | Specifies whether to enable disk encryption. | None |
ProvisionedIops | Integer | No | No | The provisioned performance. | None |
EncryptionKey | String | No | No | The Key Management Service (KMS) key used for disk encryption. | None |
RestoreType | Integer | No | No | You can recover an instance from a backup. | Valid values:
|
BackupPolicyOptions | Map | No | Yes | The backup policy configuration. | For more information, see the BackupPolicyOptions properties section. |
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 | Specifies whether to enable passwordless access to the instance 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. | This parameter is specified only when you clone an instance. It must be specified with the SrcDBInstanceId parameter. |
AccountPassword | String | No | Yes | The password of the root account. | The password must be 6 to 32 characters in length. It can contain letters, digits, and the following special characters: |
EngineVersion | String | No | No | The version number of the database. | Valid values:
|
StorageEngine | String | No | No | The storage engine. | For more information about storage engines and versions, see Versions and storage engines. 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 | Specifies whether to enable auto-renewal for the instance. | Valid values:
|
RestoreTime | String | No | No | The point in time to which you want to restore data when you clone an instance. | Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. This parameter is specified only when you clone an instance. It must be specified with the SrcDBInstanceId and BackupId parameters. You can specify a point in time within the last seven days. |
CouponNo | String | No | No | The coupon code. | The default value is youhuiquan_promotion_option_id_for_blank. |
Period | Integer | No | Yes | The subscription duration of the instance. | Unit: month. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. The default value is 1. This parameter is valid only when ChargeType is set to PrePaid. |
ChargeType | String | No | Yes | The billing method of the instance. | Valid values:
|
Tags | List | No | Yes | The tags. | You can add up to 20 tags. For more information, see the Tags properties section. |
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. | For more information, see the PrivateConnections properties section. |
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. | The length must be from 1 to 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. For more information, see the ReplicaConnections properties section. |
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 The default value is Trial. Starting from January 6, 2022, the official edition of the audit log feature is successively launched in different regions, and you can no longer apply for the free trial edition. We recommend that you set this parameter 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 | Specifies whether to forcibly enable SSL encryption for connections. | Valid values:
|
SwitchMode | Integer | No | Yes | The time to modify the SSL configuration of the MongoDB instance. | 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:
For more information, see Long-term retention backups. |
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 | Specifies whether to enable 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 | Specifies whether to enable 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 | Specifies whether to enable 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": {
}
} For more information, see the YAML example.