ALIYUN::RDS::ReadOnlyDBInstance is used to create a read-only instance for an ApsaraDB for RDS instance.

Syntax

{
  "Type": "ALIYUN::RDS::ReadOnlyDBInstance",
  "Properties": {
    "Category": String,
    "VPCId": String,
    "DBInstanceDescription": String,
    "Tags": Map,
    "EngineVersion": String,
    "DBInstanceId": String,
    "PayType": String,
    "ZoneId": String,
    "ResourceGroupId": String,
    "DBInstanceStorage": Integer,
    "VSwitchId": String,
    "DBInstanceStorageType": String,
    "DBInstanceClass": String,
    "PrivateIpAddress": String
  }
}

Properties

Name Type Required Editable Description Validity
Category String No No The edition of the read-only instance. Valid values: Basic, HighAvailability, and AlwaysOn.
VPCId String No No The ID of the VPC. None
DBInstanceDescription String No No The description of the read-only 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 and cannot start with http:// or https://.
Tags Map No Yes The tags of the read-only instance in the key-value pair format. Example: {"key1": "value1","key2": "value2", ... "key5": "value5"}. A maximum of five key-value pairs can be specified. A tag key can be up to 64 characters in length and cannot start with http:// or https://. A tag value can be up to 128 characters in length and cannot start with aliyun, http://, or https://.
EngineVersion String Yes No The database version of the read-only instance. The version must be the same as that of the primary instance. Valid values: 5.6, 5.7, 8.0, and 2017_ent.
DBInstanceId String Yes No The ID of the primary instance. None
PayType String No No The billing method of the read-only instance. Only the pay-as-you-go method is supported. Set the value to Postpaid.
ZoneId String Yes No The ID of the zone where the read-only instance resides. None
ResourceGroupId String No No The ID of the resource group. None
DBInstanceStorage Integer Yes Yes The storage capacity of the read-only instance. Unit: GB. Valid values: 5 to 3000. This value must be a multiple of 5 GB. Instances of different versions have different value ranges. For more information, see Instance types.
VSwitchId String No No The ID of the VSwitch. None
DBInstanceStorageType String No No The storage type of the read-only instance. Valid values: local_ssd/ephemeral_ssd, cloud_ssd, and cloud_essd. SQL only supports local SSDs, while MySQL Server only supports cloud SSDs.
DBInstanceClass String Yes Yes The type of the read-only instance. For more information, see Instance types. We recommend that the specifications of the read-only instance be equal to or higher than those of the primary instance. Otherwise, the read-only instance will incur high latency and high load.
PrivateIpAddress String No No The private IP address of the read-only instance. It must be within the IP address range of the specified VSwitch. The system automatically assigns an IP address through VPCId and VSwitchId.

Response parameters

Fn::GetAtt

  • ConnectionString: the internal endpoint of the read-only instance.
  • DBInstanceId: the ID of the read-only instance.
  • Port: the internal port of the read-only instance.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ReadOnlyDBInstance": {
      "Type": "ALIYUN::RDS::ReadOnlyDBInstance",
      "Properties": {
        "Category": {
          "Ref": "Category"
        },
        "VPCId": {
          "Ref": "VPCId"
        },
        "DBInstanceDescription": {
          "Ref": "DBInstanceDescription"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "DBInstanceStorageType": {
          "Ref": "DBInstanceStorageType"
        },
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "PayType": {
          "Ref": "PayType"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "DBInstanceStorage": {
          "Ref": "DBInstanceStorage"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "EngineVersion": {
          "Ref": "EngineVersion"
        },
        "DBInstanceClass": {
          "Ref": "DBInstanceClass"
        },
        "PrivateIpAddress": {
          "Ref": "PrivateIpAddress"
        }
      }
    }
  },
  "Parameters": {
    "Category": {
      "Type": "String",
      "Description": "The edition of the instance. Valid values:\n- Basic\n- HighAvailability\n- AlwaysOn",
      "AllowedValues": [
        "Basic",
        "HighAvailability",
        "AlwaysOn"
      ]
    },
    "VPCId": {
      "Type": "String",
      "Description": "The ID of the VPC."
    },
    "DBInstanceDescription": {
      "Type": "String",
      "Description": "Description of created database instance."
    },
    "Tags": {
      "Type": "Json",
      "Description": "The tags of an instance. You should input the information of the tag with the format of the Key-Value, such as {\"key1\":\"value1\",\"key2\":\"value2\", ... \"key5\":\"value5\"}.\nAt most 5 tags can be specified.\nKey\nIt can be up to 64 characters in length.\nCannot begin with aliyun.\nCannot begin with http:// or https://.\nCannot be a null string.\nValue\nIt can be up to 128 characters in length.\nCannot begin with aliyun.\nCannot begin with http:// or https://.\nCan be a null string."
    },
    "DBInstanceStorageType": {
      "Type": "String",
      "Description": "The storage type of the instance. Valid values:\n- local_ssd/ephemeral_ssd: local SSDs.\n- cloud_ssd: SSDs.\n- cloud_essd: ESSDs.",
      "AllowedValues": [
        "local_ssd/ephemeral_ssd",
        "cloud_ssd",
        "cloud_essd"
      ]
    },
    "DBInstanceId": {
      "Type": "String",
      "Description": "The ID of the master instance."
    },
    "PayType": {
      "Default": "Postpaid",
      "Type": "String",
      "Description": "The billing method. The system only supports Pay-As-You-Go. Valid value: Postpaid.",
      "AllowedValues": [
        "Postpaid"
      ]
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The ID of the zone. You can call the DescribeRegions API operation to view the latest zones."
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": "Resource group id."
    },
    "DBInstanceStorage": {
      "Type": "Number",
      "Description": "The storage space of the instance. Value range: 5 to 3000. The value must be a multiple of 5. Unit: GB."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the VSwitch."
    },
    "EngineVersion": {
      "Type": "String",
      "Description": "The version of the database. The database and the master instance must have the same database version. Valid values:\n- 5.6\n- 5.7\n- 8.0\n- 2017_ent",
      "AllowedValues": [
        "5.6",
        "5.7",
        "8.0",
        "2017_ent"
      ]
    },
    "DBInstanceClass": {
      "Type": "String",
      "Description": "The type of the instance. For more information, see Instance type list. The type of the read-only instance must be no less than that of the master instance. Otherwise, the read-only instance incurs high latency and high load."
    },
    "PrivateIpAddress": {
      "Type": "String",
      "Description": "The private IP address of the read-only instance. It must be within the IP address range provided by the switch. The system automatically assigns an IP address based on the VPCId and VSwitchId by default."
    }
  },
  "Outputs": {
    "ConnectionString": {
      "Description": "DB instance connection url by Intranet.",
      "Value": {
        "Fn::GetAtt": [
          "ReadOnlyDBInstance",
          "ConnectionString"
        ]
      }
    },
    "DBInstanceId": {
      "Description": "The instance id of created database instance.",
      "Value": {
        "Fn::GetAtt": [
          "ReadOnlyDBInstance",
          "DBInstanceId"
        ]
      }
    },
    "Port": {
      "Description": "Intranet port of created DB instance.",
      "Value": {
        "Fn::GetAtt": [
          "ReadOnlyDBInstance",
          "Port"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  ReadOnlyDBInstance:
    Type: ALIYUN::RDS::ReadOnlyDBInstance
    Properties:
      Category:
        Ref: Category
      VPCId:
        Ref: VPCId
      DBInstanceDescription:
        Ref: DBInstanceDescription
      Tags:
        Ref: Tags
      DBInstanceStorageType:
        Ref: DBInstanceStorageType
      DBInstanceId:
        Ref: DBInstanceId
      PayType:
        Ref: PayType
      ZoneId:
        Ref: ZoneId
      ResourceGroupId:
        Ref: ResourceGroupId
      DBInstanceStorage:
        Ref: DBInstanceStorage
      VSwitchId:
        Ref: VSwitchId
      EngineVersion:
        Ref: EngineVersion
      DBInstanceClass:
        Ref: DBInstanceClass
      PrivateIpAddress:
        Ref: PrivateIpAddress
Parameters:
  Category:
    Type: String
    Description:
      The edition of the instance. Valid values:
      - Basic
      - HighAvailability
      - AlwaysOn
    AllowedValues:
    - Basic
    - HighAvailability
    - AlwaysOn
  VPCId:
    Type: String
    Description: The ID of the VPC.
  DBInstanceDescription:
    Type: String
    Description: Description of created database instance.
  Tags:
    Type: Json
    Description:
      The tags of an instance.
      You should input the information of the tag with the format of the Key-Value, such as {"key1":"value1","key2":"value2", ... "key5":"value5"}.
      At most 5 tags can be specified.
      Key
      It can be up to 64 characters in length.
      Cannot begin with aliyun.
      Cannot begin with http:// or https://.
      Cannot be a null string.
      Value
      It can be up to 128 characters in length.
      Cannot begin with aliyun.
      Cannot begin with http:// or https://.
      Can be a null string.
  DBInstanceStorageType:
    Type: String
    Description:
      The storage type of the instance. Valid values:
      - local_ssd/ephemeral_ssd: local SSDs.
      - cloud_ssd: SSDs.
      - cloud_essd: ESSDs.
    AllowedValues:
    - local_ssd/ephemeral_ssd
    - cloud_ssd
    - cloud_essd
  DBInstanceId:
    Type: String
    Description: The ID of the master instance.
  PayType:
    Default: Postpaid
    Type: String
    Description: 'The billing method. The system only supports Pay-As-You-Go. Valid
      value: Postpaid.'
    AllowedValues:
    - Postpaid
  ZoneId:
    Type: String
    Description: The ID of the zone. You can call the DescribeRegions API operation
      to view the latest zones.
  ResourceGroupId:
    Type: String
    Description: Resource group id.
  DBInstanceStorage:
    Type: Number
    Description: 'The storage space of the instance. Value range: 5 to 3000. The value
      must be a multiple of 5. Unit: GB.'
  VSwitchId:
    Type: String
    Description: The ID of the VSwitch.
  EngineVersion:
    Type: String
    Description:
      The version of the database. The database and the master instance must have the same database version. Valid values:
      - 5.6
      - 5.7
      - 8.0
      - 2017_ent
    AllowedValues:
    - '5.6'
    - '5.7'
    - '8.0'
    - 2017_ent
  DBInstanceClass:
    Type: String
    Description: The type of the instance. For more information, see Instance type
      list. The type of the read-only instance must be no less than that of the master
      instance. Otherwise, the read-only instance incurs high latency and high load.
  PrivateIpAddress:
    Type: String
    Description: The private IP address of the read-only instance. It must be within
      the IP address range provided by the switch. The system automatically assigns
      an IP address based on the VPCId and VSwitchId by default.
Outputs:
  ConnectionString:
    Description: DB instance connection url by Intranet.
    Value:
      Fn::GetAtt:
      - ReadOnlyDBInstance
      - ConnectionString
  DBInstanceId:
    Description: The instance id of created database instance.
    Value:
      Fn::GetAtt:
      - ReadOnlyDBInstance
      - DBInstanceId
  Port:
    Description: Intranet port of created DB instance.
    Value:
      Fn::GetAtt:
      - ReadOnlyDBInstance
      - Port