All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::RDS::Connection

Last Updated:May 23, 2023

ALIYUN::RDS::Connection is used to apply for a public endpoint.

Syntax

{
  "Type": "ALIYUN::RDS::Connection",
  "Properties": {
    "DBInstanceId": String,
    "Port": Integer,
    "BabelfishPort": String,
    "ConnectionStringPrefix": String,
    "GeneralGroupName": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DBInstanceId

String

Yes

No

The ID of the ApsaraDB RDS instance.

None.

Port

Integer

Yes

No

The port number of the public endpoint.

Valid values: 1000 to 5999.

BabelfishPort

String

No

No

The tabular data stream (TDS) port of the instance for which Babelfish is enabled.

Note

This parameter applies only to ApsaraDB RDS for PostgreSQL instances. For more information about Babelfish for ApsaraDB RDS for PostgreSQL instances, see Introduction to Babelfish.

ConnectionStringPrefix

String

No

No

The prefix of the public endpoint.

A complete public endpoint is in the following format: Prefix.Engine name.rds.aliyuncs.com.

For example: test1234.mysql.rds.aliyuncs.com.

Note

The prefix must be 5 to 40 characters in length and can contain letters, digits, and hyphens (-). The prefix cannot contain any of the following characters: ~ ! # % ^ & * = + | { } ; : ' " , < > / ?

GeneralGroupName

String

No

No

The name of the dedicated cluster to which the instance belongs. This parameter takes effect only when the instance is created in an ApsaraDB MyBase cluster that runs MySQL on Standard Edition.

None.

Return values

Fn::GetAtt

  • DBInstanceId: the ID of the ApsaraDB RDS instance.

  • Port: the port of the public endpoint.

  • ConnectionString: the public endpoint.

  • BabelfishPort: the TDS port of the instance for which Babelfish is enabled.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBInstanceId:
    Type: String
    Description: RDS instance ID.
    Default: '****'
  Port:
    Type: Number
    Description: The port of the database service.
    MinValue: 1000
    MaxValue: 5999
    Default: 1000
Resources:
  Connection:
    Type: ALIYUN::RDS::Connection
    Properties:
      DBInstanceId:
        Ref: DBInstanceId
      Port:
        Ref: Port
Outputs:
  DBInstanceId:
    Description: RDS instance ID.
    Value:
      Fn::GetAtt:
        - Connection
        - DBInstanceId
  Port:
    Description: The port of the database service.
    Value:
      Fn::GetAtt:
        - Connection
        - Port
  ConnectionString:
    Description: Connection string
    Value:
      Fn::GetAtt:
        - Connection
        - ConnectionString
  BabelfishPort:
    Description: The name of the dedicated cluster to which the instance belongs.
    Value:
      Fn::GetAtt:
        - Connection
        - BabelfishPort

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBInstanceId": {
      "Type": "String",
      "Description": "RDS instance ID.",
      "Default": "****"
    },
    "Port": {
      "Type": "Number",
      "Description": "The port of the database service.",
      "MinValue": 1000,
      "MaxValue": 5999,
      "Default": 1000
    }
  },
  "Resources": {
    "Connection": {
      "Type": "ALIYUN::RDS::Connection",
      "Properties": {
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "Port": {
          "Ref": "Port"
        }
      }
    }
  },
  "Outputs": {
    "DBInstanceId": {
      "Description": "RDS instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "DBInstanceId"
        ]
      }
    },
    "Port": {
      "Description": "The port of the database service.",
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "Port"
        ]
      }
    },
    "ConnectionString": {
      "Description": "Connection string",
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "ConnectionString"
        ]
      }
    },
    "BabelfishPort": {
      "Description": "The name of the dedicated cluster to which the instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "BabelfishPort"
        ]
      }
    }
  }
}