Courseiva

Google ACE Deploying and Implementing a Cloud Solution Practice Question

You need to deploy a Cloud Function that is triggered by HTTP requests. You want to pass configuration parameters to the function at deployment time. Which approach 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

✓

Use the --set-env-vars flag with gcloud functions deploy.

You can set environment variables at deployment time using the --set-env-vars flag with the gcloud functions deploy command. This allows passing configuration parameters without modifying the code. Option C is correct.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Store parameters in a Cloud Storage bucket and read them at runtime.

    Why it's wrong here

    Storing parameters in a Cloud Storage bucket requires extra code to fetch and parse them at runtime, and the function's service account needs bucket read permissions. Runtime environment variables, set at deployment, inject configuration directly. Cloud Storage suits serving static assets or large files that exceed environment variable size limits.

  • ✗

    Edit the function code to hardcode the parameters.

    Why it's wrong here

    Hardcoding parameters into the function source fails because configuration values then live in the deployed artefact, so any change requires redeploying the function rather than updating its environment. It is tempting when parameters are genuinely static and never vary between environments, but the stem asks for values supplied at deployment time, which environment variables provide.

  • ✓

    Use the --set-env-vars flag with gcloud functions deploy.

    Why this is correct

    The --set-env-vars flag injects key-value pairs as environment variables during gcloud functions deploy, making them readable by the function's runtime code. This passes configuration at deployment time without hardcoding values, satisfying the stem's requirement for supplying parameters when the HTTP-triggered function is created.

  • ✗

    Include the parameters in the HTTP request body.

    Why it's wrong here

    HTTP request body parameters arrive per invocation from the caller, not at deployment, so they cannot configure the deployed function itself. It tempts because HTTP-triggered functions naturally receive runtime input this way. The stem requires values set when deploying, which environment variables provide.

About these practice questions

Courseiva writes every ACE question from scratch — 775 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 →

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.