All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::MONGODB::Instance

Last Updated:Sep 13, 2023

ALIYUN::MONGODB::Instance is used to create or clone an ApsaraDB for 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,
    "NetworkType": String,
    "Tags": List,
    "SecondaryZoneId": String,
    "HiddenZoneId": String,
    "StorageType": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

VpcPasswordFree

Boolean

No

No

Specifies whether to enable password-free access to the instance over a virtual private cloud (VPC).

Valid values:

  • true

  • false

DBInstanceStorage

Integer

Yes

Yes

The storage capacity of the 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).

Default value: false. Valid values:

  • true: enables TDE.

    Note

    You cannot disable TDE after you enable it.

  • false: disables TDE.

SrcDBInstanceId

String

No

No

The ID of the source instance.

You can specify this property only if you use ALIYUN::MONGODB::Instance to clone an instance. You must specify this property together with the BackupId property or the RestoreTime property.

DBInstanceDescription

String

No

No

The description of the instance.

The description must be 2 to 256 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The description must start with a letter.

SecurityIPArray

String

No

No

The list of IP addresses that can access the instance.

Separate multiple IP addresses with commas (,). Each IP address must be unique in the list. The list can contain up to 1,000 IP addresses.

The following types of formats are supported: IP addresses and CIDR blocks. For example, you can set the value to 0.0.0.0/0, 10.23.XX.XX (IP address), and 10.23.XX.XX/24 (CIDR block). /24 indicates that the prefix in the CIDR block is 24 characters in length. A prefix can be 1 to 32 characters in length.

The default value is 0.0.0.0/0. The value 0.0.0.0/0 indicates that all IP addresses can access the instance.

ZoneId

String

No

No

The ID of the zone in which the instance resides.

For more information, see DescribeRegions. If you set the NetworkType property to VPC, you must set the ZoneId property to the ID of the zone to which the vSwitch in the VPC belongs.

VpcId

String

No

No

The ID of the VPC.

This property takes effect when the NetworkType property is set to VPC.

SecurityGroupId

String

No

Yes

The ID of the security group.

None.

VSwitchId

String

No

No

The ID of the vSwitch.

This property takes effect when the NetworkType property is set to VPC.

BackupId

String

No

No

The ID of the backup set.

You can specify this property only if you use ALIYUN::MONGODB::Instance to clone an instance. You must specify this property together with the SrcDBInstanceId property.

NetworkType

String

No

No

The type of the network.

Default value: CLASSIC. Valid values:

  • CLASSIC

  • VPC

AccountPassword

String

No

Yes

The password of the root account.

The password must be 6 to 32 characters in length, and can contain letters, digits, and the following special characters: ! # $ % ^ & * () _ + - =.

EngineVersion

String

No

No

The version of the database engine.

Default value: 3.4. Valid values:

  • 3.4

  • 4.0

  • 4.2

  • 4.4

  • 5.0

StorageEngine

String

No

No

The storage engine of the instance.

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

Default value: WiredTiger. Valid values:

  • WiredTiger: suitable for most business scenarios.

  • RocksDB: suitable for scenarios in which a large number of write operations and a few read operations are performed.

  • TerarkDB: suitable for scenarios in which more read operations are performed than write operations, or scenarios in which multiple write operations are performed at a time and a large number of read operations are performed.

ReplicationFactor

Integer

No

No

The number of nodes in the instance.

Default value: 3. Valid values:

  • 3

  • 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 property is an additional property.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

AutoRenew

Boolean

No

No

Specifies whether to enable auto-renewal for the instance.

Default value: false. Valid values:

  • true: enables auto-renewal for the instance.

  • false: disables auto-renewal for the instance. You must manually renew the instance.

RestoreTime

String

No

No

The point in time to which the instance that you want to clone is restored.

Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

You can specify this property only when you use ALIYUN::MONGODB::Instance to clone an instance. You must specify this property together with the SrcDBInstanceId and BackupId properties. You can select a specific point in time in the next seven days of the current request to clone an instance.

CouponNo

String

No

No

The coupon code.

Default value: youhuiquan_promotion_option_id_for_blank.

Period

Integer

No

No

The subscription duration of the instance.

Unit: months.

Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36.

Default value: 1.

This property takes effect when the ChargeType property is set to PrePaid.

ChargeType

String

No

No

The billing method of the instance.

Valid values:

  • PostPaid: pay-as-you-go

  • PrePaid: subscription

Tags

List

No

Yes

The tags of the instance.

You can add up to 20 tags to the instance.

For more information, see Tags properties.

SecondaryZoneId

String

No

No

The ID of the zone in which the secondary node resides.

Valid values:

  • cn-hangzhou-g: corresponds to Hangzhou Zone G

  • cn-hangzhou-h: corresponds to Hangzhou Zone H

  • cn-hangzhou-i: corresponds to Hangzhou Zone I

  • cn-hongkong-b: corresponds to Hong Kong Zone B

  • cn-hongkong-c: corresponds to Hong Kong Zone C

  • cn-hongkong-d: corresponds to Hong Kong Zone D

  • cn-wulanchabu-a: corresponds to Ulanqab Zone A

  • cn-wulanchabu-b: corresponds to Ulanqab Zone B

  • cn-wulanchabu-c: corresponds to Ulanqab Zone C

  • ap-southeast-1a: corresponds to Singapore Zone A

  • ap-southeast-1b: corresponds to Singapore Zone B

  • ap-southeast-1c: corresponds to Singapore Zone C

  • ap-southeast-5a: corresponds to Jakarta Zone A

  • ap-southeast-5b: corresponds to Jakarta Zone B

  • ap-southeast-5c: corresponds to Jakarta Zone C

  • eu-central-1a: corresponds to Frankfurt Zone A

  • eu-central-1b: corresponds to Frankfurt Zone B

  • eu-central-1c: corresponds to Frankfurt Zone C

Note
  • This property is required if the EngineVersion property is set to 4.4 or 5.0.

  • You must set this property to a zone ID that is different from the values of the ZoneId and HiddenZoneId properties.

HiddenZoneId

String

No

No

The ID of the zone in which the hidden node resides.

Valid values:

  • cn-hangzhou-g: corresponds to Hangzhou Zone G

  • cn-hangzhou-h: corresponds to Hangzhou Zone H

  • cn-hangzhou-i: corresponds to Hangzhou Zone I

  • cn-hongkong-b: corresponds to Hong Kong Zone B

  • cn-hongkong-c: corresponds to Hong Kong Zone C

  • cn-hongkong-d: corresponds to Hong Kong Zone D

  • cn-wulanchabu-a: corresponds to Ulanqab Zone A

  • cn-wulanchabu-b: corresponds to Ulanqab Zone B

  • cn-wulanchabu-c: corresponds to Ulanqab Zone C

  • ap-southeast-1a: corresponds to Singapore Zone A

  • ap-southeast-1b: corresponds to Singapore Zone B

  • ap-southeast-1c: corresponds to Singapore Zone C

  • ap-southeast-5a: corresponds to Jakarta Zone A

  • ap-southeast-5b: corresponds to Jakarta Zone B

  • ap-southeast-5c: corresponds to Jakarta Zone C

  • eu-central-1a: corresponds to Frankfurt Zone A

  • eu-central-1b: corresponds to Frankfurt Zone B

  • eu-central-1c: corresponds to Frankfurt Zone C

Note
  • This property is required if the EngineVersion property is set to 4.4 or 5.0.

  • You must set this property to a zone ID that is different from the values of the ZoneId and SecondaryZoneId properties.

StorageType

String

No

No

The storage type of the instance.

Valid values:

  • cloud_essd1: PL1 enhanced SSD (ESSD)

  • cloud_essd2: PL2 ESSD

  • cloud_essd3: PL3 ESSD

  • local_ssd: local SSD

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

  • OrderId: the order ID of the ApsaraDB for MongoDB instance.

  • DBInstanceId: the ID of the ApsaraDB for MongoDB instance. The ID is globally unique.

  • DBInstanceStatus: the state of the ApsaraDB for MongoDB instance.

  • ConnectionURI: the connection string Uniform Resource Identifier (URI).

  • ReplicaSetName: the name of the replica set.

Examples

  • YAML format

    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: {}
  • JSON format

    {
      "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 examples, visit MongoDBInstance.json and MongoDBInstance.yml.