This needs bqto Pro.
--endpoint IP:PORT skips the lookup and forwards to that address. Use it for an instance whose
private address bqto cannot find, such as one behind a Private Service Connect endpoint that you
made yourself.
Rules
--endpointneeds an IPv4 address,--region(for the bastion), and--network.- On a terminal, it also needs
--project. With--no-input, the project falls back to the default project of gcloud. - The local port is the remote port plus 10000. Above port 55535, give a local port with
-p. - The flag gives a plain TCP forward for any
--service. The service only names the session. If you leave out--service, it iscloudsql. You get no Kafka proxy and no Cloud Run token. - With
cloudsqloralloydb,-- CMDgetsPGHOSTandPGPORT. - A profile cannot hold
--endpoint. So--saveandbqto profile createrefuse it.--webrefuses it too, because--webneeds the Cloud Run service that bqto looks up.
TLS and the hostname
A client that checks the TLS hostname fails on127.0.0.1, because the certificate names the
service, such as api.internal.example.com on an internal load balancer. After the ready line,
bqto prints one of these lines. Replace HOST with the name in the certificate.
Any other service and port gets no line. For Memorystore with TLS,
redis-cli needs
--tls --cacert server-ca.pem. It does not check the hostname.
Other clients need the same two things:
- The real name, for the certificate and SNI.
127.0.0.1with the local port, for the connection.
127.0.0.1 HOST to /etc/hosts and connect to
HOST:LOCAL_PORT. If you set -p to the remote port, the address of the client stays the same.
On Linux, ports below 1024 need root.
Check the server certificate
sslmode=require encrypts the connection, but it does not check a certificate.
Cloud SQL shows how to check the server
certificate through the tunnel.