GCEのインスタンスにssh接続できない時の対策


$ gcloud compute instances list
instance-name

で、みると一覧にはあるけど

$ gcloud compute ssh instance-name
ERROR: (gcloud.compute.ssh) Could not fetch instance:
 - The resource 'instance-path' was not found

で、なぜかつながらない時の対策


$ gcloud compute --project "project-name" ssh --zone "zone-name" "instance-name"

これでつながる。

Google Developer Console → 対象プロジェクト → (右側メニューの)コンピュート → Compute Engine → VMインスタンス → 対象インスタンスの 接続 ssh 右側のメニュー → gcloudコマンドを表示
からコピペしてきてもOK