ALIYUN::MONGODB::Instance is used to create an ApsaraDB for MongoDB instance.

Syntax

{
  "Type": "ALIYUN::MONGODB::Instance",
  "Properties": {
    "SrcDBInstanceId": String,
    "ReplicationFactor": Integer,
    "DBInstanceStorage": Integer,
    "DBInstanceDescription": String,
    "SecurityIPArray": String,
    "ZoneId": String,
    "VpcId": String,
    "VSwitchId": String,
    "EngineVersion": String,
    "StorageEngine": String,
    "BackupId": String,
    "DBInstanceClass": String,
    "NetworkType": String,
    "AccountPassword": String,
    "DatabaseNames": String,
    "ReadonlyReplicas": Integer,
    "BusinessInfo": String,
    "ResourceGroupId": String,
    "AutoRenew": Boolean,
    "RestoreTime": String,
    "CouponNo": String,
    "Period": Integer,
    "ChargeType": String
  }
}

Properties

Name Type Required Editable Description Validity
DBInstanceStorage Integer Yes No The storage capacity of the instance. Unit: GB. Valid values: 5 to 1000. The value must be a multiple of 5 GB.
DBInstanceClass String Yes No The specifications of the instance. For more information, see Instance specifications.
SrcDBInstanceId String No No The ID of the source instance. This parameter can be specified only when this API is called to clone instances. This parameter must be specified with either the BackupId parameter or the RestoreTime parameter.
DBInstanceDescription String No No The name of the instance. The description must be 2 to 256 characters in length and can contain letters, digits, underscores (_), and hyphens (-). It 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 (,). A maximum of 1,000 different IP addresses can be added. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP address format), and 10.23.12.24/24 (CIDR format). /24 indicates the length of the prefix in the CIDR block, and a prefix length can be in the range of 1 to 32. The default value is 0.0.0.0/0, indicating that no access limit is applied.
ZoneId String No No The ID of the zone. For more information, see DescribeRegions. The value of this parameter must be the same as that specified by the VSwitchId parameter in VPCs.
VpcId String No No The ID of the VPC. This parameter takes effect only when the NetworkType parameter is set to VPC.
VSwitchId String No No The ID of the VSwitch in the VPC. This parameter takes effect only when the NetworkType parameter is set to VPC.
BackupId String No No The ID of the backup set. This parameter can be specified only when this API is called to clone instances. This parameter must be specified with the SrcDBInstanceId parameter.
NetworkType String No No The network type of the instance. Valid values: CLASSIC and VPC. Default value: CLASSIC.
AccountPassword String No No The password of the root user. The password must be 8 to 32 characters in length and can contain letters, digits, and special characters. Special characters include ! # $ % ^ & * ( ) _ + - =
EngineVersion String No No The version of the database. Valid values: 3.2, 3.4, and 4.0. Default value: 3.4.
StorageEngine String No No The storage engine of the instance. For more information about storage engines and versions of instances, see Versions and storage engines. Valid values: WiredTiger, RocksDB, and TerarkDB. Default value: WiredTiger.
ReplicationFactor Integer No No The number of nodes in the replica set. Valid values: 3, 5, and 7. Default value: 3.
DatabaseNames String No No The names of databases. None
ReadonlyReplicas Integer No No The number of read-only nodes. Valid values: 1, 2, 3, 4, and 5.
BusinessInfo String No No The business information. This parameter is an additional parameter.
ResourceGroupId String No No The ID of the resource group. None
AutoRenew Boolean No No Specifies whether to enable automatic renewal for the instance. Value values: true and false. A value of true specifies that automatic renewal is enabled. A value of false specifies that automatic renewal is disabled. Default value: false.
RestoreTime String No No The point in time you want to recover the instance to. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. This parameter can be specified only when this API is called to clone instances. This parameter must be specified with the SrcDBInstanceId and BackupId parameters. You can specify any time in the past seven days for data cloning.
CouponNo String No No The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.
Period Integer No No The billing cycle for the instance. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Default value: 1. This parameter takes effect only when the ChargeType parameter is set to PrePaid.
ChargeType String No No The billing method of the instance. Valid values: PostPaid and PrePaid.

Response parameters

Fn::GetAtt

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

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "MongoDB": {
      "Type": "ALIYUN::MONGODB::Instance",
      "Properties": {
        "DBInstanceClass":"dds.mongo.mid",
        "DBInstanceStorage":"10",
        "VpcId": "vpc-25o8sqkwb",
        "VSwitchId": "vsw-25w8qld3m"
      }
    }
  },
  "Outputs": {
    "DBInstanceStatus": {
      "Description": "Status of mongodb instance.",
      "Value": {
        "Fn::GetAtt": [
          "MongoDB",
          "DBInstanceStatus"
        ]
      }
    },
    "InstanceId": {
      "Description": "The instance id of created mongodb instance.",
      "Value": {
        "Fn::GetAtt": [
          "MongoDB",
          "DBInstanceId"
        ]
      }
    }
  }
}