Skip to content
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

Cloud sql connection support #1500

Open
etabacchi opened this issue Sep 27, 2024 · 2 comments
Open

Cloud sql connection support #1500

etabacchi opened this issue Sep 27, 2024 · 2 comments

Comments

@etabacchi
Copy link

etabacchi commented Sep 27, 2024

Hi, we have a cloud sql instance with some iam users that can access to our postgres dbs, in order to access it right now we start a cloud sql proxy on a bastion-vm with the iam token of the user, we do it on the moment because the token changes based on the user and we cant have multiple proxies always running for each one.

For clarity the command we run right now to connect looks something like this gcloud compute ssh $BASTION_VM --project=$PROJECT_ID --zone=$ZONE --tunnel-through-iap --ssh-flag="-L $LOCAL_PORT:$SOCKET_FOLDER/.s.PGSQL.5432" -- /cloud_sql_proxy --private-ip --auto-iam-authn --token.

I'm aware that the documentation says that the connection to cloud sql is not possible yet but are there plans for adding support for it in future releases? Could that cover also cases like ours? I think it could be very handy

@jpassing
Copy link
Collaborator

I agree that the lack of Cloud SQL support isn't ideal. But the limiting factor here isn't IAP Desktop, but IAP itself: It's currently not possible to establish IAP-TCP tunnels to Cloud SQL instances -- you always need a VM in between. Until that changes, I'm not sure if there's much we can do in IAP Desktop to improve the user experience for Cloud SQL.

@etabacchi
Copy link
Author

A solution could be that when connecting to a vm IAP Desktop could give us the option to launch a post-command on it, in the case of my example it would be /cloud_sql_proxy --private-ip --auto-iam-authn --token but of course that could be configurable (maybe from the IAPC file?).

In this way we could spin up the proxy automatically and it should solve our problem, what do you think?

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

No branches or pull requests

2 participants