QuestionQ110

VerifiedPlanning and implementing a cloud solution

You want to deploy an application on Cloud Run that processes messages from a Pub/Sub topic. You want to follow Google-recommended practices. What should you do?

Explanation

For Cloud Run, Google recommends using an authenticated Pub/Sub push subscription rather than a pull subscription, because Cloud Run is a request-driven, scale-to-zero service that receives HTTP requests rather than continuously polling for messages. The recommended configuration is to create a dedicated service account, grant it the Cloud Run Invoker (roles/run.invoker) role on the target Cloud Run service, and then create a Pub/Sub push subscription that uses that service account for authentication (OIDC token) with the Cloud Run service URL configured as the push endpoint. This allows Pub/Sub to securely invoke the Cloud Run service for each message while ensuring only authorized callers can reach the service.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!