QuestionQ21

VerifiedIntegrating applications with Google Cloud services

You operate a system that runs on stateless Compute Engine VMs and Cloud Run instances. Cloud Run is connected to a VPC, and its ingress setting is configured as Internal. You want to schedule tasks on Cloud Run. You create a service account and grant it the roles/run.invoker Identity and Access Management (IAM) role. When you create a schedule and test it, Cloud Logging returns a 403 Permission Denied error. What should you do?

Explanation

roles/run.invoker is sufficient for authenticated invocation, but internal ingress also restricts the network path that may reach the Cloud Run service. Pub/Sub push subscriptions are recognized as internal Google Cloud traffic for a Cloud Run service with internal ingress, and Pub/Sub can authenticate the push request using a service account granted the Cloud Run Invoker role. Cloud Scheduler can therefore publish to Pub/Sub, which invokes the service without exposing it through an external load balancer.

Learn more

Community Discussion

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