The AlloyDB Java Connector is a Java library for connecting securely to your AlloyDB instances. Using a Connector provides the following benefits:
- IAM Authorization: The Connector uses IAM to ensure only principals with valid permissions are allowed to connect.
- Improved Security: The Connector uses TLS 1.3 encryption and identity verification between the client connector and the server-side proxy, independent of the database protocol.
- Convenience: The Connector removes the requirement to use and distribute SSL certificates.
This library provides a socket factory for use with the JDBC Postgres Driver. At a high level, you will need to:
- Configure IAM permissions
- Add the Connector and Postgres driver as dependencies
- Configure a connection pool that configures the driver to use the Connector as a socket factory
For information on configuring a connection, see the documentation.
If you're using Spring Boot, consider using the Spring Boot AlloyDB starter.
The Java Connector uses Application Default Credentials (ADC). For information on how to configure Application Default Credentials, see the documentation.
In addition, the associated IAM principal must have the IAM role "Cloud AlloyDB
Client" (i.e., roles/alloydb.client
). See the docs on AlloyDB IAM permissions
for more information.
The Java Connector supports optional debug logging to help diagnose problems with
the background certificate refresh. To enable it, add the following to the file
src/main/resources/application.yml
:
logging.level.com.google.cloud.alloydb=DEBUG
This project uses semantic versioning, and uses the following lifecycle regarding support for a major version:
Active - Active versions get all new features and security fixes (that would not otherwise introduce a breaking change). New major versions are guaranteed to be "active" for a minimum of 1 year.
Deprecated - Deprecated versions continue to receive security and critical bug fixes, but do not receive new features. Deprecated versions will be supported for 1 year.
Unsupported - Any major version that has been deprecated for >=1 year is considered unsupported.
We test and support at minimum, any publicly supported LTS JDK version. Changes in supported versions will be considered a minor change, and will be listed in the release notes.
This project aims for a minimum monthly release cadence. If no new features or fixes have been added, a new PATCH version with the latest dependencies is released.
This library follows Semantic Versioning.
Contributions to this library are always welcome and highly encouraged.
See CONTRIBUTING for more information how to get started.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.
Apache 2.0 - See LICENSE for more information.
Java is a registered trademark of Oracle and/or its affiliates.