Updated on 2022-02-22 GMT+08:00

RDS.MySQL

Element Description

Relational Database Service (RDS) is a cloud-based web service that is reliable, scalable, easy to manage, and ready to use out-of-the-box.

RDS provides an optimized performance monitoring system, multiple security protection measures, and a professional database management platform, helping you easily configure, operate, and expand the relational database. On the RDS console, you can execute all necessary tasks without programming, which simplifies the operation process and reduces routine O&M workload. Therefore, you can focus on application development and service development.

Element Properties

Table 1 Property Description

Property

Mandatory

Descripiton

dbPort

No

Port for accessing the instance

Type: integer

Value Description: The value ranges from 2100 to 9500. Currently, this field is invalid.

Default: 3306

Constraint: {u'in_range': [2100, 9500]}

Suggestion: Set the value within the port range based on requirements.

availabilityZone

Yes

AZ where the instance is located

Type: Cloud.ECS.AvailabilityZone.Name

Value Description: AZ where the to-be-created ECS is located. The name of the AZ needs to be specified, for example, ae-ad-1a.

Value Constraint: The value varies depending on regions.

Suggestion: Use the get_input function to set this field, and then the value can be automatically selected on the AOS console.

name

No

Instance name

Type: string

Value Description: Customize the value.

Default: ""

Value Constraint: Enter 4 to 64 characters, starting with a letter. Only letters (case-insensitive), digits, hyphens (-), and underscores (_) are allowed. 2. The name of an instance of the same type must be unique under the same account.

Suggestion: Customize the value.

dataBase

No

Configuration of the database of the instance

Type: MySQL.DataBase

Default: {u'characterSet': u'utf8', u'name': u'unset', u'collate': u'utf8_general_ci'}

Suggestion: Select the dataBase field in the component part, and then fill in the field based on prompts.

paramsGroupId

No

Parameters group ID of an instance

Type: Cloud.RDS.ParamsGroup.Id

Suggestion: It is advised to set it to a get_input function and select it from a drop-down list. You can also fill in a default parameter group ID which needs to be obtained from the RDS console.

securityGroupId

Yes

ID of the security group to which the instance belongs

Type: Cloud.VPC.SecurityGroup.Id

Value Description: Obtain the security group ID from the VPC service or connects to the VPC.SecurityGroup to automatically generate a security group ID.

Suggestion: 1. Use the get_input function to set this field, and then the value can be automatically selected on the AOS console. 2. Use the get_reference function to obtain the VPC.SecurityGroup element created by the stack. 3. Obtain the ID of the created security group from the VPC console.

dbUser

No

Configuration of the user of the instance

Type: MySQL.DBUser

Default: {u'userPassword': u'unset', u'name': u'unset'}

Suggestion: Select the dbUser field in the component part, and then fill in the field based on prompts.

dbRootPassword

Yes

Password of the root user of the instance. This parameter cannot be left blank. The password must not be a weak password. Enter 8 to 32 characters. Only letters, digits, and special characters ~!@#%^*-_=+? are allowed.

Type: password

Value Description: Customize the value.

Value Constraint: 1. The parameter must be written into inputs and set using the get_input function. 2. This parameter cannot be left blank. The password must not be a weak password. Enter 8 to 32 characters. Only letters, digits, and special characters ~!@#%^*-_=+? are allowed.

Suggestion: You are advised to use the get_input function to obtain the value and avoid plaintext passwords to ensure security.

volume

Yes

Information about the data disk used by the instance

Type: RDS.Volume

Default: {u'volumetype': u'COMMON', u'size': 100}

Suggestion: Select the volume field in the component part, and then fill in the field based on prompts.

timeZone

No

Time zone where the instance locates. This parameter is supported only in stacks billed in the yearly/monthly mode. Stacks billed in pay-per-use mode do not support setting this parameter.

Type: string

Value Description: If this parameter is specified, the value ranges from UTC-12:00 to UTC+12:00 at the full hour. For example, the value can be UTC+08:00 rather than UTC+08:30.

Value Constraint: {u'valid_values': [u'UTC-12:00', u'UTC-11:00', u'UTC-10:00', u'UTC-09:00', u'UTC-08:00', u'UTC-07:00', u'UTC-06:00', u'UTC-05:00', u'UTC-04:00', u'UTC-03:00', u'UTC-02:00', u'UTC-01:00', u'UTC', u'UTC+01:00', u'UTC+02:00', u'UTC+03:00', u'UTC+04:00', u'UTC+05:00', u'UTC+06:00', u'UTC+07:00', u'UTC+08:00', u'UTC+09:00', u'UTC+10:00', u'UTC+11:00', u'UTC+12:00']}

Suggestion: Use the get_input function to set this field, and then the value can be automatically selected on the AOS console.

backupStrategy

Yes

Backup policy of the instance

Type: RDS.BackupStrategy

Default: {u'keepDays': 0, u'endTime': u'02:00', u'startTime': u'01:00'}

Value Constraint: Set the value based on specifications.

subnetId

Yes

ID of the subnet to which the instance belongs

Type: Cloud.VPC.Subnet.Id

Value Description: Use the ID of an existing subnet or a new subnet. To use a new subnet ID, you need to define the subnet object in the template and establish the dependency. You are advised to connect the VPC.Subnet to automatically establish the dependency.

Value Constraint: The subnet must correspond to the VPC.

Suggestion: 1. Use the get_input function to set this field, and then the value can be automatically selected on the AOS console. 2. Use the get_reference function to obtain the VPC.Subnet element created by the stack. 3. Obtain the ID of the created subnet from the VPC console.

slaveAvailabilityZone

No

AZ where the standby HA instance is located

Type: Cloud.ECS.AvailabilityZone.Name

Value Description: AZ where the to-be-created ECS is located. The name of the AZ needs to be specified, for example, ae-ad-1a.

Value Constraint: The value varies depending on regions.

Suggestion: Use the get_input function to set this field, and then the value can be automatically selected on the AOS console.

dataStore

Yes

Database information

Type: MySQL.DataStore

Default: {u'dbtype': u'MySQL', u'version': u'5.7'}

Suggestion: Select the dataStore field in the component part, and then fill in the field based on prompts.

HA

Yes

HA configuration of the instance

Type: RDS.HA.Mysql

Default: {u'replicationMode': u'semisync', u'enable': u'unset'}

Suggestion: Select the HA field in the component part, and then fill in the field based on prompts.

vpcId

Yes

ID of the VPC to which the instance belongs

Type: Cloud.VPC.VPC.Id

Value Description: Use the ID of an existing VPC or a new VPC. To use a new VPC ID, you need to define the VPC object in the template and establish the dependency. You are advised to drag the object to the VPC to automatically establish the dependency.

Value Constraint: The value must satisfy the UUID generation rule.

Suggestion: 1. Use the get_input function to set this field, and then the value can be automatically selected on the AOS console. 2. Use the get_reference function to obtain the VPC.VPC element created by the stack. 3. Obtain the ID of the created VPC from the VPC console.

flavor

Yes

Instance specifications

Type: Cloud.RDS.Flavor.Id

Value Description: Flavor ID of the to-be-created database instance, which is generated based on the instance specifications and user project.

Value Constraint: Flavor IDs vary depending on project. The property must match the database type and version. In a resource specification code, for example, rds.mysql.m1.xlarge, rds indicates the RDS service. mysql indicates the database engine. m1.xlarge indicates high memory, a performance specification. If a code contains rr, it indicates that this is a read-only instance. If a code does not contain rr, it indicates that this is a single or HA database instance.

Suggestion: You are advised to obtain the value by using the RDS APIs.

Relationships Between Elements

Table 2 Relationship description

Description

Target

Connected

VPC.Subnet

Connected

VPC.SecurityGroup

Inclusion

VPC.VPC

Return Value

Property

Type

Description

refIP

string

Access IP address of the RDS MySQL instance

refPort

integer

Access port of the RDS MySQL instance

refName

string

Name of the RDS MySQL instance

refID

string

ID of the RDS MySQL instance

chargeMode

string

Billing mode of the RDS MySQL instance

Blueprint Example

tosca_definitions_version: cloud_tosca_version_1_0
node_templates:
  rdsms528:
    type: Cloud.RDS.MySQL
    properties:
      dataStore:
        dbtype: MySQL
        version: '5.7'
      dbPort: 3306
      vpcId:
        get_input: rdsms528_vpcId
      securityGroupId:
        get_input: rdsms528_securityGroupId
      availabilityZone:
        get_input: rdsms528_availabilityZone
      dbRootPassword:
        get_input: rdsms528_dbRootPassword
      volume:
        volumetype: COMMON
        size: 100
      backupStrategy:
        keepDays: 0
        endTime: '02:00'
        startTime: '01:00'
      subnetId:
        get_input: rdsms528_subnetId
      flavor:
        get_input: rdsms528_flavor
      HA:
        replicationMode: semisync
        enable:
          get_input: rdsms528_HA_enable
inputs:
  rdsms528_vpcId:
    description: ID of the VPC to which the instance belongs
    label: ''
  rdsms528_securityGroupId:
    description: ID of the security group to which the instance belongs
    label: ''
  rdsms528_availabilityZone:
    description: AZ to which the instance belongs
    label: ''
  rdsms528_dbRootPassword:
    description: 'Password of the root user of the instance. The password must be 8 to 32 characters long and cannot be a weak password. Only letters, digits, and special characters ~!@#%^*-_=+? are allowed.'
    label: ''
  rdsms528_subnetId:
    description: ID of the subnet to which the instance belongs
    label: ''
  rdsms528_flavor:
    description: Instance specifications
    label: ''
  rdsms528_HA_enable:
    description: Whether HA is supported
    label: ''