Google ACE Deploying and Implementing a Cloud Solution Practice Question
You want to deploy a Cloud Function triggered by HTTP requests. The function is written in Node.js and the entry point function is named 'helloHttp'. Which command should you use?
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 nodejs16 --trigger-http --entry-point=helloHttp --region=us-central1
The correct command specifies the runtime (nodejs16), trigger (--trigger-http), entry point (--entry-point=helloHttp), and region. --trigger-topic is for Pub/Sub, not HTTP.
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 nodejs16 --trigger-http --entry-point=helloHttp --region=us-central1
Why this is correct
This command is correct because it explicitly provides the required function name (`my-function`), specifies the Node.js 16 runtime, sets `--trigger-http` to create an HTTP-triggered Cloud Function, names the entry point (`helloHttp`) that matches the exported function in your source code, and pins the region (`us-central1`) to avoid ambiguity. In Cloud Functions, `--trigger-http` creates a public HTTPS endpoint and deploys the function to the specified location, making this the complete and valid invocation.
- ✗
gcloud functions deploy --source . --runtime nodejs16 --trigger-http --entry-point=helloHttp
Why it's wrong here
This command is missing the required positional argument: the function name. In `gcloud functions deploy`, the function name is the first parameter, not a flag; omitting it causes the gcloud CLI to error with 'Required parameter [FUNCTION_NAME] is not set.' While `--source .` is a valid flag to upload code from the current directory, the deploy command cannot infer the function name from the entry point or source, so the command fails before any deployment occurs.
- ✗
gcloud run deploy my-function --source . --runtime nodejs16 --entry-point=helloHttp
Why it's wrong here
This command uses `gcloud run deploy`, which is the command for Cloud Run services, not Cloud Functions. Cloud Run deployments use containers and require a container image or a build from source via buildpacks, but they do not accept the `--entry-point` flag in the same way as Cloud Functions; the `helloHttp` entry point is specific to Cloud Functions function code, not Cloud Run's service/container model. Even if the runtime and source are valid for Cloud Run, the semantics of a function entry point do not map to a Cloud Run service, so this will not deploy a Cloud Function.
- ✗
gcloud functions deploy my-function --runtime nodejs16 --trigger-topic my-topic --entry-point=helloHttp
Why it's wrong here
This command replaces the HTTP trigger with a Pub/Sub topic trigger by specifying `--trigger-topic my-topic`. While the other flags (function name, runtime, entry point) are correctly formed, the trigger type determines how the function is invoked: an HTTP-triggered function is called via a URL, whereas a Pub/Sub-triggered function is invoked when messages are published to the specified topic. For an HTTP request based function, the correct flag is `--trigger-http`, not `--trigger-topic`, so this command would deploy a function with the wrong event source.
Go deeper
Related to this question
Learn chapter
Google Cloud Platform Overview
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
Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.