Dr. Fabien Tarrade
Dr. Fabien Tarrade

Reputation: 1696

How to SSH with Pycharm a GCP VM without using the ephemeral external IP?

I have a GCE instance running on GCP. I can use my local Pycharm (Professional edition) to edit my code on the remote VM. The issue is that for the SSH connection (done inside Pycharm) it uses the external IP of the VM which is ephemeral. When stopping and restarting the VM I can get another external IP.

What is the best solution to not have to change the config of Pycharm everytime we have a new external IP ? (bastion ? static IP ? port forwarding ? hostname ?)

I need a solution that works without using gcloud cli directly (since it need to be setup inside Pycharm): https://cloud.google.com/compute/docs/instances/connecting-advanced

Upvotes: 1

Views: 1002

Answers (1)

Mahesh Khond
Mahesh Khond

Reputation: 1297

The best option here is to reserve and assign the static IP to your VM.

Bastion Host will not work as you have to ssh into Bastion Host and then to your VM.

Upvotes: 2

Related Questions