Recall & Review
beginner
What is a Cloud Function triggered by Pub/Sub in Google Cloud?
It is a small piece of code that runs automatically when a message is published to a specific Pub/Sub topic.
Click to reveal answer
beginner
How does Pub/Sub deliver messages to a Cloud Function?
Pub/Sub sends messages to the Cloud Function as events, which then processes the message data inside the function code.
Click to reveal answer
intermediate
Why use Pub/Sub triggers for Cloud Functions instead of HTTP triggers?
Pub/Sub triggers are good for asynchronous, event-driven processing where messages are sent reliably and can be retried if processing fails.
Click to reveal answer
intermediate
What happens if a Cloud Function fails to process a Pub/Sub message?
The message can be retried automatically by Pub/Sub until it is successfully processed or until it reaches a maximum retry limit.
Click to reveal answer
advanced
How do you secure a Cloud Function triggered by Pub/Sub?
By setting proper IAM roles so only authorized services can publish messages to the Pub/Sub topic and invoke the function.
Click to reveal answer
What triggers a Cloud Function when using Pub/Sub?
✗ Incorrect
Cloud Functions with Pub/Sub triggers run when a new message is published to the specified Pub/Sub topic.
What format does a Pub/Sub message have when received by a Cloud Function?
✗ Incorrect
Pub/Sub messages are delivered as event data, often encoded as JSON, which the function can parse and use.
If a Cloud Function fails to process a Pub/Sub message, what happens next?
✗ Incorrect
Pub/Sub automatically retries delivering messages until successful or retry limits are reached.
Which Google Cloud service is responsible for sending messages to trigger Cloud Functions?
✗ Incorrect
Cloud Pub/Sub is the messaging service that triggers Cloud Functions when messages are published.
How can you restrict who can publish messages to a Pub/Sub topic?
✗ Incorrect
IAM permissions control which users or services can publish messages to a Pub/Sub topic.
Explain how a Cloud Function is triggered by a Pub/Sub message and what happens inside the function.
Think about the flow from message sending to function execution.
You got /4 concepts.
Describe how you would secure a Cloud Function that is triggered by Pub/Sub messages.
Focus on permissions and access control.
You got /4 concepts.