Updated on 2023-08-11 GMT+08:00

RDS.PostgreSQL

Element Description

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 and service development.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

dbPort

No

Port for accessing the instance

Type: integer

Value Description: Supports 2100-9500. This field is invalid now.

Default: 5432

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

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.

name

No

Instance name

Type: string

Value Description: Supports customization.

Default: ''

Value Constraint: 1. The value must contain 4 to 64 characters and start with a letter. It is case-insensitive, and can only contain letters, digits, hyphens (-), and underscores (_). 2. The instance name of the same type under the same tenant must be unique.

Suggestion: Customize the value.

paramsGroupId

No

parameters group id of rds instance

Type: HuaweiCloud.RDS.ParamsGroup.Id

Suggestion: It is recommended to set it to the get_input form and select it from the drop-down list. It also supports filling in a default parameter group Id which needs to be obtained from the RDS page.

securityGroupId

Yes

ID of the security group to which the instance belongs

Type: HuaweiCloud.VPC.SecurityGroup.Id

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

Value Constraint: None

Suggestion: 1. Use the get_input function to import this field. The value can be automatically selected on the AOS page. 2. Use the get_reference function to obtain the VPC.SecurityGroup created by the stack. The element is automatically specified when you use the designer to establish the dependency relationship. 3. Obtain the created security group ID on the VPC page.See https://console.huaweicloud.com/vpc?&locale=en-us

dbRootPassword

Yes

Password of the root user of the instance

Type: password

Value Description: Supports customization.

Value Constraint: 1. The parameter must be written into inputs and imported using the get_input function. 2. The value is not empty. It contains 8-32 characters and is not a weak password. It contains letters, digits, and the following special characters: ~!@#%^*-_=+?

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.

slaveAvailabilityZone

No

AZ where the instance is located

Type: HuaweiCloud.ECS.AvailabilityZone.Name

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

Value Constraint: The value varies depending on the belonged region.

Suggestion: 1. Use the get_input function to import this field. The value can be automatically selected on the AOS page. 2. For details about the AZ of each region, visit https://developer.huaweicloud.com/endpoint.

subnetId

Yes

ID of the subnet to which the instance belongs

Type: HuaweiCloud.VPC.Subnet.Id

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

Value Constraint: The subnet must correspond to the VPC.

Suggestion: 1. Use the get_input function to import this field. The value is automatically selected on the AOS page. 2. Use the get_reference function to obtain the VPC.Subnet element created by the stack. The element is automatically specified when you use the designer to establish the dependency relationship. 3. Obtain the created subnet ID on the VPC page (https://console.huaweicloud.com/vpc?&locale=en-us).

timeZone

No

timeZone where the instance id located(Only used by pakage,not on deamond)

Type: string

Suggestion: Use the get_input function to import this field. The value can be automatically selected on the AOS page.

dataStore

Yes

Database information

Type: PostgreSQL.DataStore

Default: {u'dbtype': u'PostgreSQL', u'version': u'11'}

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.PostgreSQL

Default: {u'replicationMode': u'sync', 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: HuaweiCloud.VPC.VPC.Id

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

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

Suggestion: 1. Use the get_input function to import this field. The value can be automatically selected on the AOS page. 2. Use the get_reference function to obtain the VPC.VPC element created by the stack. The element is automatically specified when you use the designer to establish the dependency relationship. 3. Obtain the created VPC ID on the VPC page.See https://console.huaweicloud.com/vpc?&locale=en-us

flavor

Yes

Instance specification

Type: HuaweiCloud.RDS.Flavor.Id

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

Value Constraint: FlavorIDs vary depending on the project. The property must match the database type and version. For example, in the resource specification code rds.mysql.m1.xlarge, rds indicates the RDS database. mysql indicates the database engine. m1.xlarge indicates high memory, a performance specification. When the value contains rr, it indicates specifications for a read replica. Values without rr indicate specifications for single or primary/standby database instances.

Suggestion: You are advised to obtain the value by using the RDS API. For details, visit https://support.huaweicloud.com/eu/api-rds/rds_06_0002.html.

availabilityZone

Yes

AZ where the instance is located

Type: HuaweiCloud.ECS.AvailabilityZone.Name

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

Value Constraint: The value varies depending on the belonged region.

Suggestion: 1. Use the get_input function to import this field. The value can be automatically selected on the AOS page. 2. For details about the AZ of each region, visit https://developer-intl.huaweicloud.com/en-us/endpoint.

Relationships Between Elements

Table 2 Relationship description

Description

Target

Connected

VPC.Subnet

Connected

VPC.SecurityGroup

ContainedIn

VPC.VPC

Return Value

Property

Type

Description

refIP

string

Access IP address of the RDS PostgreSQL instance

chargeMode

string

Billing mode of the RDS PostgreSQL instance

refPort

integer

Access port of the RDS PostgreSQL instance

refID

string

ID of the RDS PostgreSQL instance

refName

string

Name of the RDS PostgreSQL instance

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
node_templates:
  rdsps24w:
    type: HuaweiCloud.RDS.PostgreSQL
    properties:
      dbPort: 3306
      vpcId:
        get_input: rdsps24w_vpcId
      securityGroupId:
        get_input: rdsps24w_securityGroupId
      dbRootPassword:
        get_input: rdsps24w_dbRootPassword
      volume:
        volumetype: COMMON
        size: 100
      backupStrategy:
        keepDays: 0
        endTime: '02:00'
        startTime: '01:00'
      subnetId:
        get_input: rdsps24w_subnetId
      dataStore:
        dbtype: PostgreSQL
        version: '10.0'
      HA:
        replicationMode: sync
        enable:
          get_input: rdsps24w_HA_enable
      flavor:
        get_input: rdsps24w_flavor
      availabilityZone:
        get_input: rdsps24w_availabilityZone
inputs:
  rdsps24w_vpcId:
    description: ID of the VPC to which the instance belongs
    label: ''
  rdsps24w_securityGroupId:
    description: ID of the security group to which the instance belongs
    label: ''
  rdsps24w_dbRootPassword:
    description: Password of the root user of the instance
    label: ''
  rdsps24w_subnetId:
    description: ID of the subnet to which the instance belongs
    label: ''
  rdsps24w_HA_enable:
    description: Whether HA is supported
    label: ''
  rdsps24w_flavor:
    description: Instance flavor
    label: ''
  rdsps24w_availabilityZone:
    description: AZ to which the instance belongs
    label: ''