Todos los productos
Search
Centro de documentos

Resource Orchestration Service:ALIYUN::GPDB::JdbcDataSource

Última actualización: Sep 18, 2026

ALIYUN::GPDB::JdbcDataSource crea un origen de datos JDBC.

Sintaxis

{
  "Type": "ALIYUN::GPDB::JdbcDataSource",
  "Properties": {
    "DBInstanceId": String,
    "JdbcUserName": String,
    "DataSourceName": String,
    "DataSourceType": String,
    "DataSourceDescription": String,
    "JdbcPassword": String,
    "JdbcConnectionString": String
  }
}

Propiedades

Propiedad

Tipo

Obligatorio

Editable

Descripción

Restricciones

DBInstanceId

String

Sí

No

El ID de la instancia.

Ninguna

JdbcUserName

String

Sí

Sí

El nombre de la cuenta de la base de datos.

Ninguna

DataSourceDescription

String

No

Sí

La descripción del origen de datos.

Ninguna

DataSourceName

String

No

No

El nombre del origen de datos.

Ninguna

DataSourceType

String

No

Sí

El tipo del origen de datos.

Ninguna

JdbcConnectionString

String

No

Sí

La cadena de conexión JDBC.

Ninguna

JdbcPassword

String

No

Sí

La contraseña de la cuenta de la base de datos.

Ninguna

Valores de retorno

Fn::GetAtt

  • ModifyTime: la hora de la última modificación.

  • CreateTime: la hora de creación del recurso.

  • JdbcUserName: el nombre de la cuenta de la base de datos.

  • ExternalDataServiceId: el ID del servicio de datos externos.

  • StatusMessage: la información sobre el estado del servicio. Si ocurre una excepción, se muestra la causa. El valor es nulo cuando el servicio funciona con normalidad.

  • JdbcPassword: la contraseña de la cuenta de la base de datos.

  • DataSourceName: el nombre del origen de datos.

  • DataSourceType: el tipo del origen de datos.

  • ConnectionMessage: si la conexión falla, se devuelve un mensaje de error; de lo contrario, se devuelve una cadena vacía ("").

  • JdbcConnectionString: la cadena de conexión JDBC.

  • DataSourceDescription: la descripción del origen de datos.

  • ConnectionStatus: el estado del servicio.

  • DataSourceId: el ID del origen de datos.

    • Ejemplos

      Escenario 1: crear un origen de datos JDBC para una instancia de AnalyticDB for PostgreSQL que se conecte a una base de datos MySQL externa y permita consultas entre bases de datos.

      ROSTemplateFormatVersion: '2015-09-01'
      Description:
        zh-cn: 为AnalyticDB PostgreSQL创建JDBC数据源,连接外部MySQL数据库实现跨库查询。
        en: Create a JDBC data source for AnalyticDB PostgreSQL to connect to an external MySQL database.
      Parameters:
        DBInstanceId:
          Type: String
          Label:
            zh-cn: GPDB实例ID
            en: GPDB Instance ID
          Description:
            zh-cn: 已有的AnalyticDB PostgreSQL实例ID。
            en: The ID of an existing AnalyticDB for PostgreSQL instance.
        DataSourceName:
          Type: String
          Label:
            zh-cn: 数据源名称
            en: Data Source Name
          Description:
            zh-cn: JDBC数据源名称,用于标识该数据源连接。
            en: The JDBC data source name for identification.
          Default: mysql_source
        JdbcConnectionString:
          Type: String
          Label:
            zh-cn: JDBC连接串
            en: JDBC Connection String
          Description:
            zh-cn: >-
              MySQL数据库的JDBC连接串,格式:
              jdbc:mysql://<主机地址>:<端口>/<数据库名>
            en: >-
              MySQL JDBC connection string, format:
              jdbc:mysql://<host>:<port>/<database>
        JdbcUserName:
          Type: String
          Label:
            zh-cn: 数据库账号
            en: Database Username
          Description:
            zh-cn: 外部MySQL数据库的登录账号。
            en: The username for the external MySQL database.
        JdbcPassword:
          Type: String
          Label:
            zh-cn: 数据库密码
            en: Database Password
          Description:
            zh-cn: 外部MySQL数据库的登录密码。
            en: The password for the external MySQL database.
          NoEcho: true
      Resources:
        JdbcDataSource:
          Type: ALIYUN::GPDB::JdbcDataSource
          Properties:
            DBInstanceId:
              Ref: DBInstanceId
            DataSourceName:
              Ref: DataSourceName
            JdbcConnectionString:
              Ref: JdbcConnectionString
            JdbcUserName:
              Ref: JdbcUserName
            JdbcPassword:
              Ref: JdbcPassword
      Outputs:
        DataSourceId:
          Label:
            zh-cn: 数据源ID
            en: Data Source ID
          Description:
            zh-cn: 创建成功的JDBC数据源ID。
            en: The ID of the created JDBC data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - DataSourceId
        ConnectionStatus:
          Label:
            zh-cn: 连接状态
            en: Connection Status
          Description:
            zh-cn: 数据源的连接状态。
            en: The connection status of the data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - ConnectionStatus
      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Description": {
          "zh-cn": "为AnalyticDB PostgreSQL创建JDBC数据源,连接外部MySQL数据库实现跨库查询。",
          "en": "Create a JDBC data source for AnalyticDB PostgreSQL to connect to an external MySQL database."
        },
        "Parameters": {
          "DBInstanceId": {
            "Type": "String",
            "Label": {
              "zh-cn": "GPDB实例ID",
              "en": "GPDB Instance ID"
            },
            "Description": {
              "zh-cn": "已有的AnalyticDB PostgreSQL实例ID。",
              "en": "The ID of an existing AnalyticDB for PostgreSQL instance."
            }
          },
          "DataSourceName": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源名称",
              "en": "Data Source Name"
            },
            "Description": {
              "zh-cn": "JDBC数据源名称,用于标识该数据源连接。",
              "en": "The JDBC data source name for identification."
            },
            "Default": "mysql_source"
          },
          "JdbcConnectionString": {
            "Type": "String",
            "Label": {
              "zh-cn": "JDBC连接串",
              "en": "JDBC Connection String"
            },
            "Description": {
              "zh-cn": "MySQL数据库的JDBC连接串,格式:jdbc:mysql://<主机地址>:<端口>/<数据库名>",
              "en": "MySQL JDBC connection string, format: jdbc:mysql://<host>:<port>/<database>"
            }
          },
          "JdbcUserName": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库账号",
              "en": "Database Username"
            },
            "Description": {
              "zh-cn": "外部MySQL数据库的登录账号。",
              "en": "The username for the external MySQL database."
            }
          },
          "JdbcPassword": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库密码",
              "en": "Database Password"
            },
            "Description": {
              "zh-cn": "外部MySQL数据库的登录密码。",
              "en": "The password for the external MySQL database."
            },
            "NoEcho": true
          }
        },
        "Resources": {
          "JdbcDataSource": {
            "Type": "ALIYUN::GPDB::JdbcDataSource",
            "Properties": {
              "DBInstanceId": {
                "Ref": "DBInstanceId"
              },
              "DataSourceName": {
                "Ref": "DataSourceName"
              },
              "JdbcConnectionString": {
                "Ref": "JdbcConnectionString"
              },
              "JdbcUserName": {
                "Ref": "JdbcUserName"
              },
              "JdbcPassword": {
                "Ref": "JdbcPassword"
              }
            }
          }
        },
        "Outputs": {
          "DataSourceId": {
            "Label": {
              "zh-cn": "数据源ID",
              "en": "Data Source ID"
            },
            "Description": {
              "zh-cn": "创建成功的JDBC数据源ID。",
              "en": "The ID of the created JDBC data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "DataSourceId"
              ]
            }
          },
          "ConnectionStatus": {
            "Label": {
              "zh-cn": "连接状态",
              "en": "Connection Status"
            },
            "Description": {
              "zh-cn": "数据源的连接状态。",
              "en": "The connection status of the data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "ConnectionStatus"
              ]
            }
          }
        }
      }

      Escenario 2: crear un origen de datos JDBC para conectarse a una base de datos PostgreSQL externa e indicar el tipo y la descripción del origen.

      ROSTemplateFormatVersion: '2015-09-01'
      Description:
        zh-cn: 创建JDBC数据源连接外部PostgreSQL数据库,配置数据源类型和描述信息。
        en: Create a JDBC data source to connect to an external PostgreSQL with type and description.
      Parameters:
        DBInstanceId:
          Type: String
          Label:
            zh-cn: GPDB实例ID
            en: GPDB Instance ID
          Description:
            zh-cn: 已有的AnalyticDB PostgreSQL实例ID。
            en: The ID of an existing AnalyticDB for PostgreSQL instance.
        DataSourceName:
          Type: String
          Label:
            zh-cn: 数据源名称
            en: Data Source Name
          Description:
            zh-cn: JDBC数据源名称。
            en: The JDBC data source name.
          Default: pg_source
        DataSourceType:
          Type: String
          Label:
            zh-cn: 数据源类型
            en: Data Source Type
          Description:
            zh-cn: 外部数据源的数据库类型。
            en: The database type of the external data source.
          Default: postgresql
        DataSourceDescription:
          Type: String
          Label:
            zh-cn: 数据源描述
            en: Data Source Description
          Description:
            zh-cn: 数据源的描述信息,便于后续管理和识别。
            en: Description of the data source for management.
          Default: External PostgreSQL data source for cross-instance federated queries
        JdbcHost:
          Type: String
          Label:
            zh-cn: 数据库主机地址
            en: Database Host
          Description:
            zh-cn: 外部PostgreSQL数据库的连接地址。
            en: The host address of the external PostgreSQL database.
        JdbcPort:
          Type: Number
          Label:
            zh-cn: 数据库端口
            en: Database Port
          Description:
            zh-cn: 外部PostgreSQL数据库的端口号。
            en: The port of the external PostgreSQL database.
          Default: 5432
          MinValue: 1
          MaxValue: 65535
        JdbcDatabase:
          Type: String
          Label:
            zh-cn: 数据库名称
            en: Database Name
          Description:
            zh-cn: 外部PostgreSQL数据库的库名。
            en: The database name of the external PostgreSQL.
        JdbcUserName:
          Type: String
          Label:
            zh-cn: 数据库账号
            en: Database Username
          Description:
            zh-cn: 外部PostgreSQL数据库的登录账号。
            en: The username for the external PostgreSQL database.
        JdbcPassword:
          Type: String
          Label:
            zh-cn: 数据库密码
            en: Database Password
          Description:
            zh-cn: 外部PostgreSQL数据库的登录密码。
            en: The password for the external PostgreSQL database.
          NoEcho: true
      Resources:
        JdbcDataSource:
          Type: ALIYUN::GPDB::JdbcDataSource
          Properties:
            DBInstanceId:
              Ref: DBInstanceId
            DataSourceName:
              Ref: DataSourceName
            DataSourceType:
              Ref: DataSourceType
            DataSourceDescription:
              Ref: DataSourceDescription
            JdbcConnectionString:
              Fn::Sub:
                - jdbc:postgresql://${Host}:${Port}/${Database}
                - Host:
                    Ref: JdbcHost
                  Port:
                    Ref: JdbcPort
                  Database:
                    Ref: JdbcDatabase
            JdbcUserName:
              Ref: JdbcUserName
            JdbcPassword:
              Ref: JdbcPassword
      Outputs:
        DataSourceId:
          Label:
            zh-cn: 数据源ID
            en: Data Source ID
          Description:
            zh-cn: 创建成功的JDBC数据源ID。
            en: The ID of the created JDBC data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - DataSourceId
        ExternalDataServiceId:
          Label:
            zh-cn: 外部数据服务ID
            en: External Data Service ID
          Description:
            zh-cn: 外部数据服务的唯一标识。
            en: The unique ID of the external data service.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - ExternalDataServiceId
        ConnectionStatus:
          Label:
            zh-cn: 连接状态
            en: Connection Status
          Description:
            zh-cn: 数据源的连接状态。
            en: The connection status of the data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - ConnectionStatus
        ConnectionMessage:
          Label:
            zh-cn: 连接信息
            en: Connection Message
          Description:
            zh-cn: 连接结果信息,连接失败时返回错误消息。
            en: Connection result message, returns error info on failure.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - ConnectionMessage
      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Description": {
          "zh-cn": "创建JDBC数据源连接外部PostgreSQL数据库,配置数据源类型和描述信息。",
          "en": "Create a JDBC data source to connect to an external PostgreSQL with type and description."
        },
        "Parameters": {
          "DBInstanceId": {
            "Type": "String",
            "Label": {
              "zh-cn": "GPDB实例ID",
              "en": "GPDB Instance ID"
            },
            "Description": {
              "zh-cn": "已有的AnalyticDB PostgreSQL实例ID。",
              "en": "The ID of an existing AnalyticDB for PostgreSQL instance."
            }
          },
          "DataSourceName": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源名称",
              "en": "Data Source Name"
            },
            "Description": {
              "zh-cn": "JDBC数据源名称。",
              "en": "The JDBC data source name."
            },
            "Default": "pg_source"
          },
          "DataSourceType": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源类型",
              "en": "Data Source Type"
            },
            "Description": {
              "zh-cn": "外部数据源的数据库类型。",
              "en": "The database type of the external data source."
            },
            "Default": "postgresql"
          },
          "DataSourceDescription": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源描述",
              "en": "Data Source Description"
            },
            "Description": {
              "zh-cn": "数据源的描述信息,便于后续管理和识别。",
              "en": "Description of the data source for management."
            },
            "Default": "External PostgreSQL data source for cross-instance federated queries"
          },
          "JdbcHost": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库主机地址",
              "en": "Database Host"
            },
            "Description": {
              "zh-cn": "外部PostgreSQL数据库的连接地址。",
              "en": "The host address of the external PostgreSQL database."
            }
          },
          "JdbcPort": {
            "Type": "Number",
            "Label": {
              "zh-cn": "数据库端口",
              "en": "Database Port"
            },
            "Description": {
              "zh-cn": "外部PostgreSQL数据库的端口号。",
              "en": "The port of the external PostgreSQL database."
            },
            "Default": 5432,
            "MinValue": 1,
            "MaxValue": 65535
          },
          "JdbcDatabase": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库名称",
              "en": "Database Name"
            },
            "Description": {
              "zh-cn": "外部PostgreSQL数据库的库名。",
              "en": "The database name of the external PostgreSQL."
            }
          },
          "JdbcUserName": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库账号",
              "en": "Database Username"
            },
            "Description": {
              "zh-cn": "外部PostgreSQL数据库的登录账号。",
              "en": "The username for the external PostgreSQL database."
            }
          },
          "JdbcPassword": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据库密码",
              "en": "Database Password"
            },
            "Description": {
              "zh-cn": "外部PostgreSQL数据库的登录密码。",
              "en": "The password for the external PostgreSQL database."
            },
            "NoEcho": true
          }
        },
        "Resources": {
          "JdbcDataSource": {
            "Type": "ALIYUN::GPDB::JdbcDataSource",
            "Properties": {
              "DBInstanceId": {
                "Ref": "DBInstanceId"
              },
              "DataSourceName": {
                "Ref": "DataSourceName"
              },
              "DataSourceType": {
                "Ref": "DataSourceType"
              },
              "DataSourceDescription": {
                "Ref": "DataSourceDescription"
              },
              "JdbcConnectionString": {
                "Fn::Sub": [
                  "jdbc:postgresql://${Host}:${Port}/${Database}",
                  {
                    "Host": {
                      "Ref": "JdbcHost"
                    },
                    "Port": {
                      "Ref": "JdbcPort"
                    },
                    "Database": {
                      "Ref": "JdbcDatabase"
                    }
                  }
                ]
              },
              "JdbcUserName": {
                "Ref": "JdbcUserName"
              },
              "JdbcPassword": {
                "Ref": "JdbcPassword"
              }
            }
          }
        },
        "Outputs": {
          "DataSourceId": {
            "Label": {
              "zh-cn": "数据源ID",
              "en": "Data Source ID"
            },
            "Description": {
              "zh-cn": "创建成功的JDBC数据源ID。",
              "en": "The ID of the created JDBC data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "DataSourceId"
              ]
            }
          },
          "ExternalDataServiceId": {
            "Label": {
              "zh-cn": "外部数据服务ID",
              "en": "External Data Service ID"
            },
            "Description": {
              "zh-cn": "外部数据服务的唯一标识。",
              "en": "The unique ID of the external data service."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "ExternalDataServiceId"
              ]
            }
          },
          "ConnectionStatus": {
            "Label": {
              "zh-cn": "连接状态",
              "en": "Connection Status"
            },
            "Description": {
              "zh-cn": "数据源的连接状态。",
              "en": "The connection status of the data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "ConnectionStatus"
              ]
            }
          },
          "ConnectionMessage": {
            "Label": {
              "zh-cn": "连接信息",
              "en": "Connection Message"
            },
            "Description": {
              "zh-cn": "连接结果信息,连接失败时返回错误消息。",
              "en": "Connection result message, returns error info on failure."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "ConnectionMessage"
              ]
            }
          }
        }
      }

      Escenario 3: crear una cuenta de GPDB y configurar un origen de datos JDBC para preparar un entorno completo de consultas federadas entre bases de datos.

      ROSTemplateFormatVersion: '2015-09-01'
      Description:
        zh-cn: 创建GPDB账号并配置JDBC数据源,实现完整的跨库联邦查询环境搭建。
        en: Create a GPDB account and JDBC data source for a complete federated query setup.
      Parameters:
        DBInstanceId:
          Type: String
          Label:
            zh-cn: GPDB实例ID
            en: GPDB Instance ID
          Description:
            zh-cn: 已有的AnalyticDB PostgreSQL实例ID。
            en: The ID of an existing AnalyticDB for PostgreSQL instance.
        AccountName:
          Type: String
          Label:
            zh-cn: GPDB账号名称
            en: GPDB Account Name
          Description:
            zh-cn: >-
              GPDB数据库账号名称,2~16个字符,
              由小写字母、数字和下划线组成,
              不能以gp开头。
            en: >-
              GPDB account name, 2-16 characters,
              lowercase letters, digits and underscores, cannot start with gp.
          Default: query_user
          AllowedPattern: '^(?!gp)[a-z][a-z0-9_]{0,14}[a-z0-9]$'
        AccountPassword:
          Type: String
          Label:
            zh-cn: GPDB账号密码
            en: GPDB Account Password
          Description:
            zh-cn: GPDB数据库账号密码,8~32个字符。
            en: GPDB account password, 8-32 characters.
          NoEcho: true
          MinLength: 8
          MaxLength: 32
        DataSourceName:
          Type: String
          Label:
            zh-cn: 数据源名称
            en: Data Source Name
          Description:
            zh-cn: JDBC数据源名称。
            en: The JDBC data source name.
          Default: external_db_source
        DataSourceType:
          Type: String
          Label:
            zh-cn: 数据源类型
            en: Data Source Type
          Description:
            zh-cn: 外部数据源的数据库类型。
            en: The database type of the external data source.
          Default: mysql
          AllowedValues:
            - mysql
            - postgresql
            - oracle
            - sqlserver
        ExternalJdbcConnectionString:
          Type: String
          Label:
            zh-cn: 外部数据库JDBC连接串
            en: External JDBC Connection String
          Description:
            zh-cn: >-
              外部数据库的JDBC连接串。
              MySQL格式:jdbc:mysql://host:3306/dbname
              PostgreSQL格式:jdbc:postgresql://host:5432/dbname
            en: >-
              External database JDBC connection string.
              MySQL format: jdbc:mysql://host:3306/dbname
              PostgreSQL format: jdbc:postgresql://host:5432/dbname
        ExternalJdbcUserName:
          Type: String
          Label:
            zh-cn: 外部数据库账号
            en: External DB Username
          Description:
            zh-cn: 外部数据库的登录账号。
            en: The username for the external database.
        ExternalJdbcPassword:
          Type: String
          Label:
            zh-cn: 外部数据库密码
            en: External DB Password
          Description:
            zh-cn: 外部数据库的登录密码。
            en: The password for the external database.
          NoEcho: true
      Resources:
        GpdbAccount:
          Type: ALIYUN::GPDB::Account
          Properties:
            DBInstanceId:
              Ref: DBInstanceId
            AccountName:
              Ref: AccountName
            AccountPassword:
              Ref: AccountPassword
            AccountType: Super
            AccountDescription: Federated query admin account
        JdbcDataSource:
          Type: ALIYUN::GPDB::JdbcDataSource
          DependsOn: GpdbAccount
          Properties:
            DBInstanceId:
              Ref: DBInstanceId
            DataSourceName:
              Ref: DataSourceName
            DataSourceType:
              Ref: DataSourceType
            DataSourceDescription:
              Fn::Sub:
                - External data source connected via ${Type} JDBC
                - Type:
                    Ref: DataSourceType
            JdbcConnectionString:
              Ref: ExternalJdbcConnectionString
            JdbcUserName:
              Ref: ExternalJdbcUserName
            JdbcPassword:
              Ref: ExternalJdbcPassword
      Outputs:
        AccountName:
          Label:
            zh-cn: GPDB账号
            en: GPDB Account
          Description:
            zh-cn: 创建成功的GPDB账号名称。
            en: The name of the created GPDB account.
          Value:
            Fn::GetAtt:
              - GpdbAccount
              - AccountName
        DataSourceId:
          Label:
            zh-cn: 数据源ID
            en: Data Source ID
          Description:
            zh-cn: 创建成功的JDBC数据源ID。
            en: The ID of the created JDBC data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - DataSourceId
        ConnectionStatus:
          Label:
            zh-cn: 连接状态
            en: Connection Status
          Description:
            zh-cn: JDBC数据源的连接状态。
            en: The connection status of the JDBC data source.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - ConnectionStatus
        StatusMessage:
          Label:
            zh-cn: 状态信息
            en: Status Message
          Description:
            zh-cn: 服务状态信息,异常时显示异常原因,正常运行时为空。
            en: Service status info, shows exception reason if any, null when running normally.
          Value:
            Fn::GetAtt:
              - JdbcDataSource
              - StatusMessage
      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Description": {
          "zh-cn": "创建GPDB账号并配置JDBC数据源,实现完整的跨库联邦查询环境搭建。",
          "en": "Create a GPDB account and JDBC data source for a complete federated query setup."
        },
        "Parameters": {
          "DBInstanceId": {
            "Type": "String",
            "Label": {
              "zh-cn": "GPDB实例ID",
              "en": "GPDB Instance ID"
            },
            "Description": {
              "zh-cn": "已有的AnalyticDB PostgreSQL实例ID。",
              "en": "The ID of an existing AnalyticDB for PostgreSQL instance."
            }
          },
          "AccountName": {
            "Type": "String",
            "Label": {
              "zh-cn": "GPDB账号名称",
              "en": "GPDB Account Name"
            },
            "Description": {
              "zh-cn": "GPDB数据库账号名称,2~16个字符,由小写字母、数字和下划线组成,不能以gp开头。",
              "en": "GPDB account name, 2-16 characters, lowercase letters, digits and underscores, cannot start with gp."
            },
            "Default": "query_user",
            "AllowedPattern": "^(?!gp)[a-z][a-z0-9_]{0,14}[a-z0-9]$"
          },
          "AccountPassword": {
            "Type": "String",
            "Label": {
              "zh-cn": "GPDB账号密码",
              "en": "GPDB Account Password"
            },
            "Description": {
              "zh-cn": "GPDB数据库账号密码,8~32个字符。",
              "en": "GPDB account password, 8-32 characters."
            },
            "NoEcho": true,
            "MinLength": 8,
            "MaxLength": 32
          },
          "DataSourceName": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源名称",
              "en": "Data Source Name"
            },
            "Description": {
              "zh-cn": "JDBC数据源名称。",
              "en": "The JDBC data source name."
            },
            "Default": "external_db_source"
          },
          "DataSourceType": {
            "Type": "String",
            "Label": {
              "zh-cn": "数据源类型",
              "en": "Data Source Type"
            },
            "Description": {
              "zh-cn": "外部数据源的数据库类型。",
              "en": "The database type of the external data source."
            },
            "Default": "mysql",
            "AllowedValues": [
              "mysql",
              "postgresql",
              "oracle",
              "sqlserver"
            ]
          },
          "ExternalJdbcConnectionString": {
            "Type": "String",
            "Label": {
              "zh-cn": "外部数据库JDBC连接串",
              "en": "External JDBC Connection String"
            },
            "Description": {
              "zh-cn": "外部数据库的JDBC连接串。MySQL格式:jdbc:mysql://host:3306/dbname,PostgreSQL格式:jdbc:postgresql://host:5432/dbname",
              "en": "External database JDBC connection string. MySQL format: jdbc:mysql://host:3306/dbname, PostgreSQL format: jdbc:postgresql://host:5432/dbname"
            }
          },
          "ExternalJdbcUserName": {
            "Type": "String",
            "Label": {
              "zh-cn": "外部数据库账号",
              "en": "External DB Username"
            },
            "Description": {
              "zh-cn": "外部数据库的登录账号。",
              "en": "The username for the external database."
            }
          },
          "ExternalJdbcPassword": {
            "Type": "String",
            "Label": {
              "zh-cn": "外部数据库密码",
              "en": "External DB Password"
            },
            "Description": {
              "zh-cn": "外部数据库的登录密码。",
              "en": "The password for the external database."
            },
            "NoEcho": true
          }
        },
        "Resources": {
          "GpdbAccount": {
            "Type": "ALIYUN::GPDB::Account",
            "Properties": {
              "DBInstanceId": {
                "Ref": "DBInstanceId"
              },
              "AccountName": {
                "Ref": "AccountName"
              },
              "AccountPassword": {
                "Ref": "AccountPassword"
              },
              "AccountType": "Super",
              "AccountDescription": "Federated query admin account"
            }
          },
          "JdbcDataSource": {
            "Type": "ALIYUN::GPDB::JdbcDataSource",
            "DependsOn": "GpdbAccount",
            "Properties": {
              "DBInstanceId": {
                "Ref": "DBInstanceId"
              },
              "DataSourceName": {
                "Ref": "DataSourceName"
              },
              "DataSourceType": {
                "Ref": "DataSourceType"
              },
              "DataSourceDescription": {
                "Fn::Sub": [
                  "External data source connected via ${Type} JDBC",
                  {
                    "Type": {
                      "Ref": "DataSourceType"
                    }
                  }
                ]
              },
              "JdbcConnectionString": {
                "Ref": "ExternalJdbcConnectionString"
              },
              "JdbcUserName": {
                "Ref": "ExternalJdbcUserName"
              },
              "JdbcPassword": {
                "Ref": "ExternalJdbcPassword"
              }
            }
          }
        },
        "Outputs": {
          "AccountName": {
            "Label": {
              "zh-cn": "GPDB账号",
              "en": "GPDB Account"
            },
            "Description": {
              "zh-cn": "创建成功的GPDB账号名称。",
              "en": "The name of the created GPDB account."
            },
            "Value": {
              "Fn::GetAtt": [
                "GpdbAccount",
                "AccountName"
              ]
            }
          },
          "DataSourceId": {
            "Label": {
              "zh-cn": "数据源ID",
              "en": "Data Source ID"
            },
            "Description": {
              "zh-cn": "创建成功的JDBC数据源ID。",
              "en": "The ID of the created JDBC data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "DataSourceId"
              ]
            }
          },
          "ConnectionStatus": {
            "Label": {
              "zh-cn": "连接状态",
              "en": "Connection Status"
            },
            "Description": {
              "zh-cn": "JDBC数据源的连接状态。",
              "en": "The connection status of the JDBC data source."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "ConnectionStatus"
              ]
            }
          },
          "StatusMessage": {
            "Label": {
              "zh-cn": "状态信息",
              "en": "Status Message"
            },
            "Description": {
              "zh-cn": "服务状态信息,异常时显示异常原因,正常运行时为空。",
              "en": "Service status info, shows exception reason if any, null when running normally."
            },
            "Value": {
              "Fn::GetAtt": [
                "JdbcDataSource",
                "StatusMessage"
              ]
            }
          }
        }
      }