
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 a Cloud Function
/ 33
Create an API Gateway
/ 33
Create a Pub/Sub Topic and Publish Messages via API Backend
/ 34
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
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:
You are just starting your junior data analyst role. So far you have been helping teams create, manage and access backend data resources.
You are expected to have the skills and knowledge for these tasks.
You are asked to help a newly formed development team with some of their initial work on a new project around exposing backend services as APIs. You have been asked to assist the team with their efforts using API Gateway, and you receive a request to complete the following tasks:
Each task is described below, good luck!
Create a new Cloud Run function (2nd gen
) called gcfunction
in the Node.js 22
and allowing unauthenticated invocations. For now, simply have the function return "Hello World!" when invoked.
Click Check my progress to verify the objective.
Once the Cloud Run function is deployed, configure an API Gateway to proxy requests to the backend.
Create a file named openapispec.yaml
(using the code below), which references the Cloud Run function deployed in Task 1.
Use openapispec.yaml
when deploying the API Gateway with the following properties:
Name | Value |
---|---|
Display Name | gcfunction API (wherever requested) |
API ID | gcfunction-api |
Select a service account | Compute Engine default service account |
Location | |
Config Name | gcfunction-api |
Click Check my progress to verify the objective.
The development team would like the API backend to publish messages to a new Pub/Sub topic named demo-topic
.
Create a new Pub/Sub topic (demo-topic
) and push messages to it in the Cloud Run function deployed earlier. Be sure to keep the option to create a default subscription enabled when creating the topic.
Use the snippet below to update the package.json
file and index.js
code in the Cloud Run function deployed in Task 1.
Redeploy the Cloud Run function once the index.js
and package.json
files have been updated.
Next, invoke the Cloud Run function via API Gateway. If done correctly, a message will be published to the topic demo-topic
you've created in this task.
Click Check my progress to verify the objective.
You have completed the challenge to deploy and manage an API exposing the backend service with a fully managed gateway.
...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 April 01, 2025
Lab Last Tested April 01, 2025
Copyright 2025 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 will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one