Bird
0
0

Given this 2nd generation Cloud Function deployment command:

medium📝 Predict Output Q4 of 15
GCP - Cloud Functions
Given this 2nd generation Cloud Function deployment command:
gcloud functions deploy myFunc --runtime python312 --gen 2 --trigger-topic myTopic --region europe-west1
What is the expected behavior when a message is published to 'myTopic'?
AThe function will not trigger because 2nd gen does not support Pub/Sub triggers
BThe function will fail deployment due to missing HTTP trigger
CThe function will trigger but execute in the default region us-central1
DThe function will trigger and execute in the europe-west1 region
Step-by-Step Solution
Solution:
  1. Step 1: Analyze trigger type and region

    The command specifies a Pub/Sub topic trigger and region europe-west1 for 2nd gen function.
  2. Step 2: Understand 2nd gen behavior

    2nd gen supports Pub/Sub triggers and respects the specified region for execution.
  3. Final Answer:

    The function triggers on 'myTopic' and runs in europe-west1 -> Option D
  4. Quick Check:

    2nd gen supports Pub/Sub triggers in specified region [OK]
Quick Trick: 2nd gen supports Pub/Sub triggers with region flag [OK]
Common Mistakes:
  • Assuming 2nd gen lacks Pub/Sub support
  • Ignoring region flag and defaulting to us-central1

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes