ALIYUN::MONGODB::Instance is used to create or clone an ApsaraDB for MongoDB (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
  }
}

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: enables password-free access.
  • false: disables password-free access.
DBInstanceStorage Integer Yes No The storage capacity of the instance.

Valid values: 10 to 3000. The value must be a multiple of 10.

Unit: GB.
DBInstanceClass String Yes No The type of the instance. For more information, see Instance types .
TDEStatus Boolean No Yes Specifies whether to enable Transparent Data Encryption (TDE). Valid values:
  • true: enables TDE.
    Note You cannot disable TDE after you enable TDE.
  • false (default): disables TDE.
SrcDBInstanceId String No No The ID of the source instance. You can specify this parameter only if you call the operation to clone an instance. You must specify this parameter together with the BackupId parameter or the RestoreTime parameter.
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 IP addresses that can access the instance.

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

Supported formats include 0.0.0.0/0, 10.23.XX.XX (IP address format), and 10.23.XX.XX/24 (CIDR format). /24 specifies the length of the prefix in a CIDR block. The length of a prefix can be 1 to 32.

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

ZoneId String No No The ID of the zone. For more information, see DescribeRegions. This parameter must be set to the zone ID of the vSwitch in the VPC.
VpcId String No No The ID of the VPC. This parameter is valid only when the NetworkType parameter 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 parameter is valid only when the NetworkType parameter is set to VPC.
BackupId String No No The ID of the backup set. You can specify this parameter only if you call the operation to clone an instance. You must specify this parameter together with the SrcDBInstanceId parameter.
NetworkType String No No The network type. Valid values:
  • CLASSIC (default): a classic network.
  • VPC: a 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 engine version of the instance. Valid values:
  • 3.4 (default)
  • 4.0
  • 4.2
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.
Valid values:
  • WiredTiger: applicable to most business scenarios. This is the default value.
  • RocksDB: applicable to scenarios that require a large number of writes and a few reads.
  • TerarkDB: applicable to scenarios that require more reads than writes or batch writes and a large number of reads.
ReplicationFactor Integer No No 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 No The number of read-only nodes. Valid values: 1 to 5.
BusinessInfo String No No The business information. This parameter 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: enables auto-renewal.
  • false (default): disables auto-renewal for the instance.
RestoreTime String No No The point in time to which the cloned instance is restored. The time follows the yyyy-MM-ddTHH:mm:ssZ format and is displayed in UTC.

You can specify this parameter only if you call the operation to clone an instance. You must specify this parameter together with the SrcDBInstanceId and BackupId parameters. You can set this parameter to a point in time in the last seven days.

CouponNo String No No The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.
Period Integer No No The subscription period of the instance. Unit: months.

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

Default value: 1.

This parameter is valid only when the ChargeType parameter 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. You can add up to 20 tags to each instance.

For more information, see Tags properties.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The tag key. The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.
Value String No No The tag value. The tag value must be 0 to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with acs: or aliyun.

Response parameters

Fn::GetAtt

  • OrderId: the order ID of the MongoDB instance.
  • DBInstanceId: the unique ID of the MongoDB instance.
  • DBInstanceStatus: the status of the MongoDB instance.
  • ConnectionURI: the connection URI.
  • ReplicaSetName: the name of the replica set.

Examples

  • YAMLformat

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

    {
      "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": {
      }
    }           

To view more examples, see MongoDBInstance.json and MongoDBInstance.yml.