Skip to content

feat: Automatically configure connections using DNS. Part of #2043. #2044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

hessjcg
Copy link
Collaborator

@hessjcg hessjcg commented Jul 18, 2024

A connection may be configured to using a DNS name instead of an instance name. If the cloudSqlInstance property is
set to be a domain name instead of an instance name, the connector will look up a SRV record for that name and
connect to that instance.

There should be exactly 1 SRV for the database instance. The connector will always use the SRV record with the
highest priority.

Part of #2043

@hessjcg hessjcg requested a review from a team as a code owner July 18, 2024 21:24
@hessjcg hessjcg requested a review from enocom July 18, 2024 21:26
@hessjcg hessjcg force-pushed the gh-2043-configure-with-dns branch from 2665b01 to c41d806 Compare July 18, 2024 21:33
@hessjcg hessjcg changed the base branch from main to gh-2043-java-dns-wrapper July 18, 2024 21:34
@hessjcg hessjcg force-pushed the gh-2043-java-dns-wrapper branch from 300da39 to cb75da8 Compare July 19, 2024 15:24
@hessjcg hessjcg force-pushed the gh-2043-configure-with-dns branch from c41d806 to 46e95c4 Compare July 19, 2024 15:33
@hessjcg hessjcg requested a review from jackwotherspoon July 19, 2024 16:19
package com.google.cloud.sql.core;

/** Resolves the Cloud SQL Instance from the configuration name. */
interface InstanceConnectionNameResolver {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to make this package private for now -- but you'll want to plan for making this interface public so that callers can configure their own resolver.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1153 as an example of someone who already asked for this.

@hessjcg hessjcg merged commit 13f3828 into gh-2043-java-dns-wrapper Jul 24, 2024
15 checks passed
@hessjcg hessjcg deleted the gh-2043-configure-with-dns branch July 24, 2024 20:38
@hessjcg hessjcg restored the gh-2043-configure-with-dns branch July 24, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants