Deploy a Cloud Run service to process messages from a Cloud Pub/Sub topic following Google-recommended practices. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a service account, grant it the Cloud Run Invoker role for your service, and create a Pub/Sub push subscription that uses that service account and your Cloud Run service as the push endpoint..
Why this is the answer
The recommended practice for Pub/Sub to Cloud Run integration is using a push subscription. This involves creating a service account with the Cloud Run Invoker role, which grants it permission to invoke your Cloud Run service. This service account is then associated with the push subscription, allowing Pub/Sub to securely push messages directly to your Cloud Run endpoint. Using a Cloud Function as an intermediary adds unnecessary latency and cost. While pulling messages directly from Cloud Run is possible, push subscriptions are generally more efficient and scalable for event-driven architectures. Deploying on Cloud Run on GKE with a separate consumer container introduces more complexity than necessary for this common integration pattern.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed