Bird
0
0

Which of the following is the correct way to specify a Pub/Sub trigger in a Cloud Function deployment command?

easy📝 Configuration Q12 of 15
GCP - Cloud Pub/Sub

Which of the following is the correct way to specify a Pub/Sub trigger in a Cloud Function deployment command?

gcloud functions deploy myFunction --trigger-?
A--trigger-http my-topic
B--trigger-bucket my-topic
C--trigger-topic my-topic
D--trigger-event my-topic
Step-by-Step Solution
Solution:
  1. Step 1: Identify the trigger type for Pub/Sub

    Pub/Sub triggers require specifying the topic name with --trigger-topic.
  2. Step 2: Match the correct flag

    --trigger-topic is the correct flag; others relate to storage or HTTP triggers.
  3. Final Answer:

    --trigger-topic my-topic -> Option C
  4. Quick Check:

    Pub/Sub trigger uses --trigger-topic [OK]
Quick Trick: Pub/Sub triggers use --trigger-topic flag [OK]
Common Mistakes:
  • Using --trigger-bucket which is for Cloud Storage
  • Using --trigger-http which is for HTTP triggers
  • Confusing event triggers with topic triggers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes