ALIYUN::PolarDBX::DBInstance类型用于创建PolarDB-X 2.0实例。
语法
{
  "Type": "ALIYUN::PolarDBX::DBInstance",
  "Properties": {
    "TopologyType": String,
    "EngineVersion": String,
    "ResourceGroupId": String,
    "VPCId": String,
    "AutoRenew": Boolean,
    "VSwitchId": String,
    "Period": String,
    "PayType": String,
    "DBNodeClass": String,
    "SecondaryZone": String,
    "TertiaryZone": String,
    "DBNodeCount": Integer,
    "PrimaryZone": String,
    "UsedTime": Integer,
    "DBInstanceDescription": String,
    "SecurityIpConfig": Map
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| TopologyType | String | 是 | 否 | 拓扑类型。 | 取值: 
 | 
| EngineVersion | String | 是 | 否 | 数据库引擎版本。 | 
 | 
| ResourceGroupId | String | 否 | 否 | 资源组ID。 | 无 | 
| VPCId | String | 是 | 否 | 专有网络ID。 | 无 | 
| AutoRenew | Boolean | 否 | 否 | 是否自动续费。 | 取值: 
 | 
| VSwitchId | String | 是 | 否 | 虚拟交换机ID。 | 无 | 
| Period | String | 否 | 否 | 收费周期。 | 
 | 
| PayType | String | 否 | 否 | 实例付费类型。 | 取值: 
 | 
| DBNodeClass | String | 是 | 否 | 节点规格。 | 取值: 
 | 
| SecondaryZone | String | 否 | 否 | 次可用区。 | 无 | 
| TertiaryZone | String | 否 | 否 | 第三可用区。 | 无 | 
| DBNodeCount | Integer | 是 | 否 | 实例节点数量。 | 最小值为2。 | 
| PrimaryZone | String | 是 | 否 | 主可用区。 | 无 | 
| UsedTime | Integer | 否 | 否 | 预付费时长。 | 说明  当Period取值为Year时,该参数支持的取值为1、2、3。 | 
| DBInstanceDescription | String | 否 | 是 | 实例备注描述。 | 无 | 
| SecurityIpConfig | Map | 否 | 否 | 实例白名单配置。 | 更多信息,请参见SecurityIpConfig属性。 | 
SecurityIpConfig语法
"SecurityIpConfig": {
  "SecurityIPList": String,
  "ModifyMode": String,
  "GroupName": String
}SecurityIpConfig属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| SecurityIPList | String | 否 | 否 | 白名单组中的IP列表。 | 多个IP白名单间以“,”分隔。 | 
| ModifyMode | String | 否 | 否 | 白名单修改方式, | 取值: 
 | 
| GroupName | String | 否 | 否 | 实例的白名单组名。 | 无 | 
返回值
Fn::GetAtt
- OrderId:订单号。 
- DBInstanceName:创建的实例名称。 
- Port:内网连接端口。 
- ConnectionString:内网连接串。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TopologyType:
    Type: String
    Description: 'The topology type of the instance. Valid values: 3azones: The instance is deployed in three zones. 1azone: The instance is deployed in only one zone.'
    AllowedValues:
      - 1azone
      - 3azones
  EngineVersion:
    Type: String
    Description: The version of the database engine.
  VPCId:
    Type: String
    Description: The ID of the VPC to which the instance belongs.
  VSwitchId:
    Type: String
    Description: The ID of the vSwitch.
  DBNodeClass:
    Type: String
    Description: The specification of the nodes in the instance you want to create.
  DBNodeCount:
    Type: Number
    Description: The number of nodes in the instance you want to create.
    MinValue: 2
  PrimaryZone:
    Type: String
    Description: The primary zone.
Resources:
  DBInstance:
    Type: ALIYUN::PolarDBX::DBInstance
    Properties:
      TopologyType:
        Ref: TopologyType
      EngineVersion:
        Ref: EngineVersion
      VPCId:
        Ref: VPCId
      VSwitchId:
        Ref: VSwitchId
      DBNodeClass:
        Ref: DBNodeClass
      DBNodeCount:
        Ref: DBNodeCount
      PrimaryZone:
        Ref: PrimaryZone
Outputs:
  OrderId:
    Description: The ID of the order.
    Value:
      Fn::GetAtt:
        - DBInstance
        - OrderId
  DBInstanceName:
    Description: The name of the instance that you create.
    Value:
      Fn::GetAtt:
        - DBInstance
        - DBInstanceName{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TopologyType": {
      "Type": "String",
      "Description": "The topology type of the instance. Valid values: 3azones: The instance is deployed in three zones. 1azone: The instance is deployed in only one zone.",
      "AllowedValues": [
        "1azone",
        "3azones"
      ]
    },
    "EngineVersion": {
      "Type": "String",
      "Description": "The version of the database engine."
    },
    "VPCId": {
      "Type": "String",
      "Description": "The ID of the VPC to which the instance belongs."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the vSwitch."
    },
    "DBNodeClass": {
      "Type": "String",
      "Description": "The specification of the nodes in the instance you want to create."
    },
    "DBNodeCount": {
      "Type": "Number",
      "Description": "The number of nodes in the instance you want to create.",
      "MinValue": 2
    },
    "PrimaryZone": {
      "Type": "String",
      "Description": "The primary zone."
    }
  },
  "Resources": {
    "DBInstance": {
      "Type": "ALIYUN::PolarDBX::DBInstance",
      "Properties": {
        "TopologyType": {
          "Ref": "TopologyType"
        },
        "EngineVersion": {
          "Ref": "EngineVersion"
        },
        "VPCId": {
          "Ref": "VPCId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "DBNodeClass": {
          "Ref": "DBNodeClass"
        },
        "DBNodeCount": {
          "Ref": "DBNodeCount"
        },
        "PrimaryZone": {
          "Ref": "PrimaryZone"
        }
      }
    }
  },
  "Outputs": {
    "OrderId": {
      "Description": "The ID of the order.",
      "Value": {
        "Fn::GetAtt": [
          "DBInstance",
          "OrderId"
        ]
      }
    },
    "DBInstanceName": {
      "Description": "The name of the instance that you create.",
      "Value": {
        "Fn::GetAtt": [
          "DBInstance",
          "DBInstanceName"
        ]
      }
    }
  }
}