Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create the blue server
/ 15
Create the green server
/ 15
Install Nginx and customize the welcome page
/ 30
Create the tagged firewall rule
/ 15
Create a test-vm
/ 10
Create a Network-admin service account
/ 15
Create the blue server
/ 15
Create the green server
/ 15
Install Nginx and customize the welcome page
/ 30
Create the tagged firewall rule
/ 15
Create a test-vm
/ 10
Create a Network-admin service account
/ 15
In the real world, you need to protect sensitive data and ensure the continued availability of your web applications at all times. In this lab, you learn how to use Google Cloud VPC networking to create a secure, scalable, and manageable web server deployment.
You will create two nginx web servers on the default VPC network and control external HTTP access using tagged firewall rules. Then, you will explore IAM roles and service accounts to understand least-privilege administrative access for networking and security roles.
In this lab, you learn how to perform the following tasks:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
In this section, you create two web servers (blue and green) in the default VPC network. You will use automated startup scripts to install nginx and customize the welcome page on each server, applying a network tag to the blue server.
Create the blue server with the web-server network tag.
In the Google Cloud console, on the Navigation menu (), select Compute Engine > VM instances.
Click Create instance.
In Machine configuration, specify the following:
| Property | Value |
|---|---|
| Name | blue |
| Region | |
| Zone | |
| Boot disk |
|
Scroll down to the bottom of the page and expand Advanced options.
Click the Networking tab. For Network tags, type web-server
Click the Management tab, scroll down to Automation / Startup script, and paste the following script:
Click Check my progress to verify your performed task.
Create the green server without a network tag.
On the VM instances page, click Create instance.
In Machine configuration, specify the following:
| Property | Value |
|---|---|
| Name | green |
| Region | |
| Zone | |
| Boot disk |
|
Scroll down and expand Advanced options.
Click the Management tab, scroll down to Automation / Startup script, and paste the following script:
Click Check my progress to verify your performed task.
The startup scripts automatically install Nginx and write the custom HTML welcome pages as each instance boots.
Click Check my progress to verify your performed task.
Create a tagged firewall rule to allow external HTTP traffic only to VM instances tagged with web-server.
In the Google Cloud console, on the Navigation menu (), select VPC network > Firewall.
Notice the pre-existing default-allow-internal firewall rule, which permits internal communication across all instances in the default VPC.
Click Create firewall rule and configure the following settings:
| Property | Value |
|---|---|
| Name | allow-http-web-server |
| Network | default |
| Targets | Specified target tags |
| Target tags | web-server |
| Source filter | IPv4 Ranges |
| Source IPv4 ranges | 0.0.0.0/0 |
| Protocols and ports | Check tcp, type 80; check Other protocols, type icmp
|
Click Create.
Click Check my progress to verify your performed task.
Create a test-vm instance from Cloud Shell to test internal VPC reachability.
Open Cloud Shell.
Run the following command to create the test-vm instance in the
Click Check my progress to verify your performed task.
In Cloud Shell, inspect the internal and external IP addresses of your instances and test network connectivity.
You should see the output:
curl from test-vm:Cloud IAM lets you authorize who can take action on specific resources. In this section, you explore the differences between two core networking roles:
roles/compute.networkAdmin): Permissions to create, modify, and delete networking resources, except for firewall rules and SSL certificates.roles/compute.securityAdmin): Permissions to create, modify, and delete firewall rules and SSL certificates.A service account named network-admin has been pre-created for this lab. Grant it the Compute Network Admin role.
network-admin service account exists:In the navigation pane, click IAM, and then click Grant access.
For New principals, paste the network-admin service account email address shown in step 1.
For Select a role, select Compute Engine > Compute Network Admin, and then click Save.
Click Check my progress to verify your performed task.
network-admin service account:gcloud --impersonate-service-account) or Workload Identity Federation instead of downloading persistent JSON keys. For more information, see Best practices for managing service account keys.This succeeds because the Network Admin role grants compute.firewalls.list.
The output should show:
In the Google Cloud console, on the Navigation menu (), select IAM & Admin > IAM.
Locate the network-admin service account in the permissions list and click the Edit principal (pencil) icon.
Change Role to Compute Engine > Compute Security Admin.
Click Save.
Return to Cloud Shell and retry deleting the firewall rule:
The output should confirm deletion:
The connection hangs and times out, confirming that external HTTP access is blocked after the firewall rule was deleted.
In this lab, you created two nginx web servers using automated startup scripts and controlled external HTTP access with tagged firewall rules. You also explored the separation of responsibilities between the Network Admin and Security Admin IAM roles.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated November 7, 2026
Lab Last Tested November 7, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one