With Cloud Code's Compute Engine integration, you can view the Compute Engine VMs running your applications, establish connections to your VMs using SSH, view application logs, and upload files to a VM.
This page shows you how to access Compute Engine with Cloud Code and manage your VM instances.
To view VMs in your Google Cloud project and view instance details page in Google Cloud console from Cloud Code, follow these steps:
Click the Compute Engine tab or click View > Tool Windows > Compute Engine.
If you don't already have a Google Cloud project selected, click Select a Google Cloud Project, select the project, and then click OK.
Expand the All VM Instances snippet to view your VM instances.
To view the VM instance details in Google Cloud console, right-click the VM instance and select Open in Cloud Console.
Adding and viewing favorite VMs
IntelliJ supports favorite VM instances per Google Cloud project, which are retained between VM restarts. To add VMs to your favorites list and to view the list, follow these steps:
In the Compute Engine tab, under the All VM Instances snippet, right-click a VM instance and select Add to Favorites.
To view your favorites list, expand the Favorite VM Instances snippet.
To remove a VM from your favorites list, right-click the VM and select Remove from Favorites.
Connecting to a VM
To connect to the VM instance in Cloud Code using the built-in IDE terminal and SSH, follow these steps:
To connect to a VM instance, right-click the VM instance and select Open SSH connection.
A terminal appears, displaying information about the remote instance.
If the connection to the VM instance fails, an error message dialog appears. Click Troubleshoot in terminal to view information in the terminal about the issue and potential resolutions, or click View troubleshooting guide to view Troubleshooting SSH documentation.
Viewing application logs on a VM
To view application logs of a VM instance in your IDE, right-click the VM instance and select View Logs Explorer. This takes you to the Logs Explorer in Google Cloud console.
Uploading a file to a VM
To copy application files from your local IDE to your remote VM instance, follow these steps:
To upload a file to a VM, click a VM instance and then click cloud_upload Upload at the top of the Compute Engine pane, or right-click the VM instance and select Upload a file/directory.
Navigate to the file that you want to upload and click Open. A terminal opens with the list of files and progress of the upload.
If the upload fails, the SSH Connectivity Troubleshooting dialog appears. Clicking each option gives you the following results:
- View file transfer guide: Opens Transferring files to Linux VMs for more information on transferring files to Compute Engine VM instances.
- Troubleshoot in terminal: Views information in the terminal about the issue and potential resolutions.
- View troubleshooting guide: Opens Troubleshooting SSH for more information about common errors that you may run into when connecting to a VM using SSH, ways to resolve errors, and methods for diagnosing failed SSH connections.