GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-proxy

How to use the cloud-sql-auth proxy with Private Service Connect from developer machines

Offen
#2,158 15 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @hessjcg Auf GitHub ansehen
priority: p2 type: feature request
Vorherrschende Sprache
Go
Sterne
1.4k
Forks
352
Ø Merge
14 Std. 54 Min.
Gemergte PRs (30 T.)
5

Beschreibung

### Question

Hi, according to the docs [1] the cloud-sql-auth proxy requires the private DNS zone to contain a record mapping the instance DNS to the service attachment IP. This works great from within the VPC, but not from laptops connected to the VPC via a VPN.

The command I'm running:
```
cloud-sql-proxy --auto-iam-authn --psc PROJECT:REGION:REDACTED
```

Results in errors like this:
```

2024/03/25 11:06:09 [REDACTED] failed to connect to instance: Dial error: failed to dial (connection name = "PROJECT:REGION:REDACTED"): dial tcp: lookup XXXXXXXX.YYYYYYYYY.REGION.sql.goog.: no such host
```

To solve this I can add an entry in my local hosts file mapping `XXXXXXXX.YYYYYYYYY.REGION.sql.goog` to the IP address of the forwarding rule (private, but accessible via my VPN). This works, but the developer ergonomics isn't great.

Is there a plan to make this simpler, or is there something obvious I'm missing? I really want to be able to use the auth proxy so I don't have to manage certificates etc.

Let me know if you need any more information, thanks!

1. https://cloud.google.com/sql/docs/postgres/configure-private-service-connect#connect-cloud-sql-auth-proxy

### Code

_No response_

### Additional Details

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.