Skip to content

Support MySQL Connector/J loadbalance:// protocol with IAM authentication #1589

@bhavin2211

Description

@bhavin2211

Describe the feature

Enable the AWS Advanced JDBC Wrapper's IAM authentication plugin to work with MySQL Connector/J's loadbalance:// protocol, allowing query-level load balancing across RDS MySQL read replicas while using IAM database authentication.

Currently, the wrapper's object identity checks fail when the MySQL driver switches between connection objects during load balancing, making it impossible to use both IAM authentication and the driver's native load balancing feature together.

This feature would allow JDBC URLs like:
jdbc:aws-wrapper:mysql:loadbalance://replica1.rds.amazonaws.com,replica2.rds.amazonaws.com,replica3.rds.amazonaws.com:
to work correctly with IAM authentication, providing:

  • Automatic query distribution across read replicas
  • IAM token-based authentication with credential rotation

Without this feature, users must choose between IAM authentication OR load balancing, or migrate to Aurora, or implement complex application-level workarounds.

Use Case

Our current setup would like to use Wrapper to leverage IAM Authentication,

  • Adopt IAM database authentication for improved security and automatic credential rotation,
  • Maintain query-level load balancing across read replicas.

This feature would allow to use IAM Plugin for AWS RDS with MySQL driver, potentially even postgress driver should face the same issue since the library expects database instance to be resolved while checking for switch between connection.

Proposed Solution

Modify the wrapper to detect and handle when the underlying MySQL driver switches connection objects during load balancing by maybe implementing a connection proxy that delegates to the current active connection.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

The AWS Advanced JDBC Driver version used

aws-advanced-jdbc-wrapper-2.4.0

JDK version used

jdk21

Operating System and version

AL2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions