Courseiva
Deploying and Implementing a Cloud SolutioneasyMultiple SelectObjective-mapped

Google ACE Deploying and Implementing a Cloud Solution Practice Question

A developer wants to deploy a Cloud Function that is triggered by messages in a Pub/Sub topic. Which TWO flags are required in the gcloud functions deploy command?

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

--runtime

For a Pub/Sub-triggered Cloud Function, you must specify --trigger-topic and --runtime. The --entry-point is optional if the function name matches. --memory and --timeout are optional.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • --runtime

    Why this is correct

    The `--runtime` flag is mandatory because it tells the Cloud Functions deployment service which language runtime to use, such as `python312` or `nodejs20`. This value must match the code you are uploading, including the expected base image and dependencies, so the platform can build the function in the correct environment. Without specifying it, the gcloud command will fail, as there is no sensible default language choice.

  • --trigger-topic

    Why this is correct

    The `--trigger-topic` flag is required when deploying a background Cloud Function that is invoked by messages published to a Pub/Sub topic. It associates the function with a specific topic, and the platform automatically creates a subscription to deliver messages to the function. If the topic does not already exist, you must create it beforehand, because the deployment will not create it for you.

  • --timeout

    Why it's wrong here

    The `--timeout` flag is optional because there is a default timeout of 60 seconds that governs the maximum execution time allowed for your function. You can extend it up to 540 seconds for HTTP-triggered functions, but for Pub/Sub triggers it remains configurable. This flag does not affect how the function is triggered or deployed; it only sets a limit on how long the function can run before being terminated.

  • --memory

    Why it's wrong here

    The `--memory` flag is optional and defaults to 256MB, which sets the amount of memory allocated to each function instance. Memory allocation also proportionally affects the CPU and other resources, so a higher value can improve performance, but it is purely a configuration tuning knob. Leaving it unset does not impact the ability to deploy a Pub/Sub-triggered function, since the default is reasonable for many workloads.

  • --entry-point

    Why it's wrong here

    The `--entry-point` flag is not required because it defaults to the name of the deployed function (the name you supply in the gcloud command). It is only needed when the exported function name in your source code differs from the deployment name, allowing you to map a short deployment name to a longer or differently named function in code. Omitting it causes the platform to look for a function with the exact deployment name, which works in most cases.

About these practice questions

This ACE question is part of Courseiva's 769-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 →

How Courseiva writes practice questions · Editorial policy

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.