Property definition
Data source type: polardb
Supported configuration modes (ConnectionPropertiesMode):
Connection string mode (UrlMode)
Instance mode (InstanceMode)
Instance mode of the current Alibaba Cloud account
Parameter | Type | Example | Required | Description and note |
regionId | String | cn-shanghai | Yes | The ID of the region to which the instance belongs. |
clusterId | String | pc-2ze82jv51re2990g5 | Yes | The ID of the PolarDB cluster. |
database | String | mysql_database | Yes | The name of the database. |
dbType | String | mysql | Yes | The type of the PolarDB compute engine. Valid values:
|
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
readOnlyDBInstance | String | pc-2ze82jv51re2990g5.rwlb.rds.aliyuncs.com:3306 | No | The address of the secondary database. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Instance mode of another Alibaba Cloud account
Parameter | Type | Example | Required | Description and note |
regionId | String | cn-shanghai | Yes | The ID of the region to which the instance belongs. |
clusterId | String | pc-2ze82jv51re2990g5 | Yes | The ID of the PolarDB cluster. |
database | String | mysql_database | Yes | The name of the database. |
dbType | String | mysql | Yes | The type of the PolarDB compute engine. Valid values:
|
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
crossAccountOwnerId | String | 1 | Yes | The ID of another Alibaba Cloud account. |
crossAccountRoleName | String | mysql-role | Yes | The name of the RAM role assumed by another Alibaba Cloud account. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Connection string mode
Parameter | Type | Example | Required | Description and note |
dbType | String | mysql | Yes | The type of the PolarDB compute engine. Valid values:
|
address | Array | | Yes | The address, which can contain one or more pairs of host and port. |
database | String | mysql_database | Yes | The name of the database. |
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
properties | JSON Object | | No | The properties of the driver. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Configuration example of a data source
Instance mode of the current Alibaba Cloud account
{
"envType": "Prod",
"dbType": "mysql",
"clusterId": "pc-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"username": "aliyun",
"password": "xxx",
"securityProtocol": "authTypeNone"
}Instance mode of another Alibaba Cloud account
{
"envType": "Prod",
"dbType": "postgresql",
"clusterId": "pc-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"username": "aliyun",
"password": "xxx",
"crossAccountOwnerId": "1234567890",
"crossAccountRoleName": "my_ram_role",
"securityProtocol": "authTypeNone"
}Connection string mode
{
"envType": "Prod",
"dbType": "mysql",
"address": [
{
"host": "127.0.0.1",
"port": 5432
}
],
"database": "db",
"properties": {
"connectTimeout": "2000"
},
"username": "aliyun",
"password": "xxx"
}