Connecting to AlloyDB using SQL Connector
Prerequisites
To enable Coginiti connect to an AlloyDB cluster using SQL Connector, provide the Application Default Credentials (ADC) file with user or service account credentials. The exact method of sharing an ADC file with Coginiti depends on a type of Coginiti product:
-
Coginiti Pro
The easiest way to set up ADC and share it with Coginiti Pro is to install the gcloud CLI on your computer. For detailed instructions on setting up ADC, see https://cloud.google.com/docs/authentication/provide-credentials-adc. -
Coginiti Team and Coginiti Enterprise
Log into Coginiti Administration Console. Select the Config tab and navigate to the Google Cloud Platform section. Click on Configure Application Default Credentials and upload an ADC file. It is recommended to use ADC with credentials of a service account by using service account impersonation.
Configuring connection
- To add a new connection, navigate to the File top menu and click on Edit Connections (or press [⌘ + O] | [Ctrl + O]), or click the Add icon (➕) next to the Connections header in the Database Explorer panel, and select AlloyDB:
- To finish creating a connection, enter valid data in the fields of the New connection dialog
- Connection name – Replace the default New Connection with a meaningful value.
- Database JDBC driver – Specify user drivers for the data source, or click the 'download them' link below this field settings area. For detailed instructions on setting up drivers, see Add a user driver to an existing connection.
- Connection Option – The default value is SQL Connector
-
Connection URI – The URI of the AlloyDB instance to connect to. The connection URI format is
projects/{project_id}/locations/{region_id}/clusters/{cluster_id}/instances/{instance_id} -
Authentication method – You have two options to set up the authentication mechanism:
1. Build-in database authentication uses standard PostgreSQL authentication based on a username and password.
2. IAM authentication uses IAM user or service account to login to AlloyDB via OAuth 2.0 tokens. - Database - Select the database to connect to.
- Connection timeout (sec) – The default value is 0. Specify another timeout, if needed, to tell the session when to disconnect.
-
Advanced Properties – Supply additional JDBC parameters if needed.
🔎 TIP: If you connect to an AlloyDB cluster from outside its VPC, you should add the advanced property of alloydbIpType = PUBLIC
- Click Test to ensure that the connection to the data source is successful.
- Click Save. A newly created connection will be displayed in your Database Explore panel just right under the Connections header.
Connecting to AlloyDB using Public/Private IP
- To add a new connection, navigate to the File top menu and click on Edit Connections (or press [⌘ + O] | [Ctrl + O]), or click the Add icon (➕) next to the Connections header in the Database Explorer panel, and select AlloyDB:
- To finish creating a connection, enter valid data in the fields of the New connection dialog
- Connection name – Replace the default New Connection with a meaningful value.
- Database JDBC driver – Specify user drivers for the data source, or click the 'download them' link below this field settings area. For detailed instructions on setting up drivers, see Add a user driver to an existing connection.
- Connection Option – Select the Public/Private IP option.
- Public/Private IP – The IP address of the AlloyDB instance to connect to.
- User and Password – Enter your AlloyDB database credentials.
- Database - Select the database to connect to.
- Connection timeout (sec) – The default value is 0. Specify another timeout, if needed, to tell the session when to disconnect.
-
Advanced Properties – Supply additional JDBC parameters if needed.
🔎 TIP: If you connect to an AlloyDB cluster from outside its VPC, you should add the advanced property of alloydbIpType = PUBLIC
- Click Test to ensure that the connection to the data source is successful.
- Click Save. A newly created connection will be displayed in your Database Explore panel just right under the Connections header.
🔎 NOTE: If you need more advanced information on how to set up an AlloyDB connection, please, contact us through support@coginiti.co