Intrigued by the art of cloud architecture? Discover how to design, develop, and manage robust, secure, scalable, and dynamic solutions on Google Cloud as you prepare for the Professional Cloud Architect exam!
Cloud Code is a powerful extension that integrates Google Cloud services directly into the Cloud Shell Editor and Cloud Shell Terminal. This extension is available by default and allows developers to manage the entire lifecycle of their applications directly inside the web browser. It simplifies cloud-native development by providing customized templates and configuration snippets for services like Google Kubernetes Engine (GKE) and Cloud Run. By utilizing these integrated features, development teams can avoid switching between different tools and work much more efficiently.
To speed up development, Cloud Code uses Skaffold to automate the creation of Container Images and provide continuous feedback as you write code. Developers can build these containers using several integrated methods directly from their workspace. This automation ensures that shifting from local coding to active cloud deployment is fast and reliable. The supported container build methods include:
Managing Kubernetes Manifests is made much simpler through intelligent authoring and real-time configuration validation. The editor provides real-time linting and context-based completions to ensure your YAML configuration files are completely accurate before deployment. You can easily deploy these configured applications to GKE or run them locally on test clusters like minikube. Catching and validating these manifest errors early prevents deployment failures and keeps your cloud infrastructure aligned with best practices.
Cloud Code provides a tailored debugging experience that allows you to set breakpoints and step through code running on live clusters. The system automatically handles complex network tasks like port forwarding so that you can focus on resolving issues within your GKE or Cloud Run services. You can also monitor your applications using the integrated Log Viewer and Cloud Run Explorer to watch resource statuses and read real-time application logs. These tightly coupled tools enable developers to troubleshoot problems rapidly without leaving the editing environment.
Security is enhanced through direct integration with Secret Manager, which lets you securely store and fetch sensitive information like API keys programmatically. Developers can also browse and enable Cloud APIs and install required client libraries directly within the editor interface. This centralized management ensures that all necessary cloud resources remain easily accessible while maintaining a strong security posture. Using these native features helps your team maintain strict security standards throughout both the implementation and management phases.
Cloud Shell provides a temporary virtual machine running a Debian-based operating system to help you manage your Google Cloud resources. This system is completely ephemeral, meaning the underlying virtual machine is automatically discarded after one hour of inactivity. Because it is designed for immediate administrative use, it comes pre-installed with the Google Cloud CLI (gcloud CLI) and other essential software development kits (SDKs). This ensures that operators can run management commands immediately without needing any local machine configuration.
To ensure your work is not lost when the temporary virtual machine is discarded, Google provides 5 GB of free persistent disk storage mounted as your home directory. This storage is completely private to each user and remains attached to your profile even when switching between different projects. Your files and custom configurations persist reliably across different sessions, meaning you do not have to recreate your workspace each time you log in. Important items that stay saved between your sessions include:
.bashrc and .vimrc which customize your command-line environment.$HOME folder.The Cloud Shell Editor is a built-in integrated development environment based on Code OSS. It allows you to browse directory trees and edit files directly in your web browser while keeping the Cloud Shell Terminal open in a split window. While you cannot install custom marketplace extensions in this environment, Cloud Code is pre-installed to assist you with developing cloud-native applications. This setup provides out-of-the-box management tools for Kubernetes clusters, Cloud Run services, and general cloud resource operations.
Cloud Shell acts as a browser-based tool that provides a centralized command-line interface for managing Google Cloud resources. The accompanying Cloud Shell Editor allows developers to write, edit, and debug their code directly in the web browser. Because this environment comes pre-loaded with the Google Cloud CLI and other essential development tools, there is no need to install any software locally. This zero-setup environment allows developers to quickly build and test applications without the hassle of configuring local operating systems.
Cloud Code integrates directly with Gemini Code Assist, which is an artificial intelligence collaborator designed to help you write and manage code. Developers can use natural language prompts to ask Gemini to write new functions, explain complex logic, or suggest fixes for errors. This integration significantly speeds up the development process by providing real-time assistance and reducing the time spent on repetitive tasks. By working alongside this AI assistant, developers can understand existing codebases faster and deploy high-quality code with fewer bugs.
To safely test your applications, you can use the Web Preview feature to monitor local ports and view how your app functions. The Cloud Shell Terminal also supports port forwarding, which lets you establish secure connections to services running inside private networks. This secure path is often achieved by creating secure tunnels through Identity-Aware Proxy (IAP) to reach virtual machines that do not have public IP addresses. There are three key connectivity options available:
Using these options allows you to validate application behavior while keeping your backend cloud infrastructure safe and private. By keeping resources off the public internet, you significantly reduce the attack surface of your application. This setup ensures that only authenticated developers can interact with active test services.
When a virtual machine experiences boot or networking issues, you can use the Serial Console to troubleshoot the problem in text mode. This tool provides interactive access to the virtual machine's system output, which is essential when standard SSH or RDP connections fail. For Windows-based machines, tools like Chrome Remote Desktop or IAP Desktop allow you to manage the graphical interface securely over the web. Having these alternative connection methods ensures that administrators can diagnose and fix instances even during major network failures.
Managing access to these development tools requires assigning specific Identity and Access Management (IAM) roles, such as the Service Usage Consumer role, to ensure only authorized users can enable and use APIs. You can further protect your project environment by using VPC Service Controls, which create a strict security perimeter around your resources to prevent data theft. This security boundary ensures that sensitive information stays within your trusted network and cannot be exfiltrated to the outside. Following the principle of least privilege ensures that your testing and implementation environments remain secure and organized.
Prepare and test your skills
Prepare and test your skills
Cloud Code supports Buildpacks, Jib, and Docker for building container images. Buildpacks compile secure images directly from source code without needing a Dockerfile. Jib provides an optimized pathway specifically for containerizing Java applications. Docker serves as the standard platform for building and running containerized environments.
Cloud Shell provides a temporary virtual machine that is ephemeral and automatically discarded after one hour of inactivity. However, Google provides 5 GB of free persistent disk storage mounted as your home directory, which remains private to each user and persists across sessions. Your configuration files, custom scripts, and project files remain saved between logins.
Three key connectivity options are available: Port Forwarding maps a local port on your virtual terminal to a remote cloud service for direct testing. Web Preview allows you to view and interact with web applications running on port 8080 through your browser. IAP Tunneling provides a secure, encrypted way to access private cloud resources without exposing them to the public internet.
Cloud Code integrates directly with Secret Manager, which lets you securely store and fetch sensitive information like API keys programmatically. This centralized management ensures that all necessary cloud resources remain easily accessible while maintaining a strong security posture throughout both implementation and management phases.
Execute gcloud builds submit on each code save and configure Cloud Profiler with Cloud Trace to capture execution stack traces from GKE workloads
Configure skaffold.yaml and a cloudcode.kubernetes launch configuration in launch.json, then run the Cloud Code: Debug on Kubernetes action with watch mode enabled
Use the Cloud Shell Terminal to execute skaffold dev, manually configure kubectl port-forward for language ports, and create a standard remote SSH launch configuration
Configure a continuous delivery pipeline in Google Cloud Deploy with Cloud Build triggers, and use Cloud Logging Logpoint injection to inspect remote execution
A software engineering team is developing a containerized microservices application targeted for Google Kubernetes Engine (GKE). The team uses the browser-based Cloud Shell Editor and wants to accelerate their development inner loop.
They have the following requirements:
Which workflow and configuration should the team implement in Cloud Shell Editor?