Google AlloyDB

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

  1. 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:

  2. To finish creating a connection, enter valid data in the fields of the New connection dialog
  3. Connection name – Replace the default New Connection with a meaningful value.
  4. 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.
  5. Connection Option – The default value is SQL Connector
  6. 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}
  7. 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.
  8. Database - Select the database to connect to.
  9. Connection timeout (sec) – The default value is 0. Specify another timeout, if needed, to tell the session when to disconnect.
  10. 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

  11. Click Test to ensure that the connection to the data source is successful.
  12. 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

  1. 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:

  2. To finish creating a connection, enter valid data in the fields of the New connection dialog
  3. Connection name – Replace the default New Connection with a meaningful value.
  4. 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.
  5. Connection Option – Select the Public/Private IP option.
  6. Public/Private IP – The IP address of the AlloyDB instance to connect to. 
  7. User and Password – Enter your AlloyDB database credentials. 
  8. Database - Select the database to connect to.
  9. Connection timeout (sec) – The default value is 0. Specify another timeout, if needed, to tell the session when to disconnect.
  10. 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

  11. Click Test to ensure that the connection to the data source is successful.
  12. 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

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request