All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::MONGODB::Instance

Last Updated:Feb 05, 2026

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:

  • true: Enable TDE.

    Note

    Once enabled, TDE cannot be disabled.

  • false (default): Disable TDE.

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
  • This parameter is required when RestoreType is set to 2 or 3.

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:

  • true: Enabled.

  • false: Disabled.

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:

  • 0: Restore the instance from a specified backup set.

  • 1: Restore the instance to a specified point in time.

  • 2: Restore a released instance from a specified backup set.

  • 3: Restore the instance from a specified geo-redundant backup set.

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:

  • true: Enable passwordless access.

  • false: Disable passwordless access.

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:

  • 3.4 (default)

  • 4.0

  • 4.2

  • 4.4

  • 5.0

StorageEngine

String

No

No

The storage engine.

For more information about storage engines and versions, see Versions and storage engines.

Valid values:

  • WiredTiger (default): Suitable for most scenarios.

  • RocksDB: Suitable for scenarios with many writes and a few reads.

  • TerarkDB: Suitable for scenarios with more reads than writes, or scenarios with batch writes and many reads.

ReplicationFactor

Integer

No

Yes

The number of nodes in the replica set.

Valid values:

  • 3 (default)

  • 5

  • 7

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:

  • true: Enable auto-renewal.

  • false (default): The resource requires manual renewal.

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:

  • PostPaid: Pay-as-you-go.

  • PrePaid: Subscription.

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:

  • cn-hangzhou-g: Hangzhou Zone G.

  • cn-hangzhou-h: Hangzhou Zone H.

  • cn-hangzhou-i: Hangzhou Zone I.

  • cn-hongkong-b: Hong Kong (China) Zone B.

  • cn-hongkong-c: Hong Kong (China) Zone C.

  • cn-hongkong-d: Hong Kong (China) Zone D.

  • cn-wulanchabu-a: Ulanqab Zone A.

  • cn-wulanchabu-b: Ulanqab Zone B.

  • cn-wulanchabu-c: Ulanqab Zone C.

  • ap-southeast-1a: Singapore Zone A.

  • ap-southeast-1b: Singapore Zone B.

  • ap-southeast-1c: Singapore Zone C.

  • ap-southeast-5a: Jakarta Zone A.

  • ap-southeast-5b: Jakarta Zone B.

  • ap-southeast-5c: Jakarta Zone C.

  • eu-central-1a: Frankfurt Zone A.

  • eu-central-1b: Frankfurt Zone B.

  • eu-central-1c: Frankfurt Zone C.

Note
  • This parameter is available and required when EngineVersion is set to 4.4 or 5.0.

  • The value of this parameter cannot be the same as the value of ZoneId or HiddenZoneId.

HiddenZoneId

String

No

No

The zone where the hidden node is deployed.

Valid values:

  • cn-hangzhou-g: Hangzhou Zone G.

  • cn-hangzhou-h: Hangzhou Zone H.

  • cn-hangzhou-i: Hangzhou Zone I.

  • cn-hongkong-b: Hong Kong (China) Zone B.

  • cn-hongkong-c: Hong Kong (China) Zone C.

  • cn-hongkong-d: Hong Kong (China) Zone D.

  • cn-wulanchabu-a: Ulanqab Zone A.

  • cn-wulanchabu-b: Ulanqab Zone B.

  • cn-wulanchabu-c: Ulanqab Zone C.

  • ap-southeast-1a: Singapore Zone A.

  • ap-southeast-1b: Singapore Zone B.

  • ap-southeast-1c: Singapore Zone C.

  • ap-southeast-5a: Jakarta Zone A.

  • ap-southeast-5b: Jakarta Zone B.

  • ap-southeast-5c: Jakarta Zone C.

  • eu-central-1a: Frankfurt Zone A.

  • eu-central-1b: Frankfurt Zone B.

  • eu-central-1c: Frankfurt Zone C.

Note
  • This parameter is available and required when EngineVersion is set to 4.4 or 5.0.

  • The value of this parameter cannot be the same as the value of ZoneId or SecondaryZoneId.

StorageType

String

No

No

The storage class.

Valid values:

  • cloud_essd1: PL1 ESSD.

  • cloud_essd2: PL2 ESSD.

  • cloud_essd3: PL3 ESSD.

  • local_ssd: Local SSD.

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 aliyun or acs: and cannot contain http:// or https://.

Value

String

No

No

The tag value.

The value must be 0 to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.

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:

  • enable: Enables the audit log.

  • disabled: Disables the audit log.

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:

  • Trial: Free trial version.

  • Standard: Official version.

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:

  • Open: Enable SSL encryption.

  • Close: Disable SSL encryption.

  • Update: Update the SSL certificate.

ForceEncryption

Integer

No

Yes

Specifies whether to forcibly enable SSL encryption for connections.

Valid values:

  • 1: Force SSL encryption.

  • 0: Do not force SSL encryption.

SwitchMode

Integer

No

Yes

The time to modify the SSL configuration of the MongoDB instance.

Valid values:

  • 0: Modify immediately.

  • 1: Modify within the O&M window.

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:

  • update: Modify the geo-redundancy policy.

  • delete: Delete the geo-redundancy policy.

BackupInterval

Integer

No

Yes

The high-frequency backup frequency.

Valid values:

  • -1: Disable high-frequency backup.

  • 30: Every 30 minutes.

  • 60: Every 1 hour.

  • 120: Every 2 hours.

  • 180: Every 3 hours.

  • 240: Every 4 hours.

  • 360: Every 6 hours.

  • 480: Every 8 hours.

  • 720: Every 12 hours.

BackupRetentionPolicyOnClusterDeletion

Integer

No

Yes

Backup retention policy.

Valid values:

  • 0: Immediately delete all backup sets of the instance when the instance is released.

  • 1: Automatically create a backup when the instance is released and retain the backup set for a long term.

  • 2: Automatically create a backup when the instance is released and retain all backup sets of the cluster for a long term.

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
  • For users who created their accounts before September 10, 2021, the default retention period is 7 days.

  • If your instance is created after September 10, 2021, backups are retained for 30 days by default.

InstanceType

String

No

Yes

The instance type.

Valid values:

  • replicate

  • sharding

Note
  • This parameter is required when you restore a deleted instance.

  • This parameter is required when you clone an instance from a geo-redundant backup.

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
  • This parameter is required for geo-redundant backups.

  • This parameter is required and takes effect only when CrossRetentionType is set to delay.

CrossBackupPeriod

String

No

Yes

Geo-redundancy retention period

Valid values:

  1. Monday

  2. Tuesday

  3. Wednesday

  4. Thursday

  5. Friday

  6. Saturday

  7. Sunday

Note

This parameter is required for geo-redundant backups.

  • Separate multiple values with commas (,).

  • If you configure a regular backup policy, the days specified for this parameter must be a subset of the days specified for the PreferredBackupPeriod parameter.

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
  • delay: Retain for a period of time.

  • never: Never expires.

EnableCrossLogBackup

Integer

No

Yes

Specifies whether to enable cross-region log backup.

Note

This parameter is required for geo-redundant backups.

  • 1: Enable. This value is required for sharded cluster instances. For replica set instances, this value is required if you want to enable point-in-time recovery across regions.

  • 0: Disable.

PreferredBackupPeriod

String

No

Yes

The backup cycle.

Valid values:

  • Monday.

  • Tuesday

  • Wednesday

  • Thursday

  • Friday: Friday.

  • Saturday.

  • Sunday

Note

Separate multiple values with commas (,).

PreserveOneEachHour

Boolean

No

Yes

Specifies whether to enable hourly sparse backup.

Valid values:

  • true: If the backup frequency is measured in minutes, all snapshots created within the last hour are retained. For snapshots created more than 1 hour ago but within the last 24 hours, only the first snapshot created after the full hour is retained.

  • false: All snapshots are retained within the high-frequency backup retention period.

SnapshotBackupType

String

No

Yes

The snapshot backup type.

Valid values:

  • Flash: Backup within seconds.

  • Standard: Regular backup (default).

CrossLogRetentionType

String

No

Yes

The retention policy for cross-region log backups.

Valid values:

  • delay: Retain for a period of time.

  • never: Never expires.

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:

  • 0: Disable (default).

  • 1. Open.

SrcRegion

String

No

Yes

The region of the instance.

Note
  • This parameter is required for restoring a deleted instance.

  • This parameter is required for geo-redundant backups.

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.