Google ACE Deploying and Implementing a Cloud Solution Practice Question
An engineer wants to deploy a Python function that processes messages from a Pub/Sub topic. The function should be triggered whenever a message is published to the topic. Which command should the engineer use to deploy the function?
⚠ Common exam trap
ACE often tests the exact flag spelling and trigger type — candidates confuse --entry-point with --entry-points, or pick --trigger-http/--trigger-bucket when the scenario explicitly requires Pub/Sub topic triggering.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud functions deploy my-function --runtime python39 --trigger-topic my-topic --entry-point main --region=us-central1
The correct command uses --trigger-topic my-topic to bind the function to a Pub/Sub topic, and --entry-point main (singular) to name the function entry point. This deploys a background function that Cloud Functions invokes whenever a message is published to the topic. The runtime and region flags are also correctly specified.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gcloud functions deploy my-function --runtime python39 --trigger-http --entry-point main --region=us-central1
Why it's wrong here
The --trigger-http flag configures an HTTP-triggered function, exposing an HTTPS endpoint that invokes the function when a request is made. It does not create a Pub/Sub subscription, so the function would never fire from messages published to a topic. To meet the requirement, you must use --trigger-topic, which registers a background function tied to Pub/Sub.
- ✗
gcloud functions deploy my-function --runtime python39 --trigger-topic my-topic --entry-points main --region=us-central1
Why it's wrong here
The flag --entry-points is misspelled; gcloud functions deploy only accepts the singular --entry-point. This command fails with an invalid flag error before touching any deployment. Even though --trigger-topic my-topic is correctly specified, the typo prevents the function from being deployed.
- ✓
gcloud functions deploy my-function --runtime python39 --trigger-topic my-topic --entry-point main --region=us-central1
Why this is correct
This is the correct command because --trigger-topic my-topic binds the function to Pub/Sub, causing it to be invoked every time a message is published to that topic. The --entry-point main identifies the Python callable in the code, while --runtime python39 specifies the runtime. It correctly deploys a background Cloud Function without exposing an HTTP endpoint.
- ✗
gcloud functions deploy my-function --runtime python39 --trigger-bucket my-bucket --entry-point main --region=us-central1
Why it's wrong here
The --trigger-bucket flag configures the function to be triggered by Cloud Storage events such as object finalization or deletion in the specified bucket. This is unrelated to Pub/Sub topics, so the function wouldn't process messages as required. Use --trigger-topic instead to listen to a Pub/Sub topic.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
Learn chapter
Google Cloud Deploy for CD
Key term
Region
A region is a distinct geographic location where a cloud provider operates multiple data centers that are connected by low-latency networks and provide cloud services.
Key term
Pub/Sub
Pub/Sub is a messaging pattern where publishers send messages without knowing who receives them, and subscribers receive only the messages they care about.
About these practice questions
This ACE question is part of Courseiva's 775-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.