You need to configure Cloud Pub/Sub to trigger a Cloud Run microservice named `event-processor` using a secure push subscription. The Cloud Run service must reject any direct unauthenticated HTTP traffic from the public internet. Arrange the operational steps in the correct order to set up this secure integration.
- 1Create a dedicated service account to serve as the Cloud Pub/Sub push subscription identity.
- 2Deploy or update the `event-processor` Cloud Run service using the `--no-allow-unauthenticated` flag.
- 3Grant the `roles/run.invoker` role on the `event-processor` Cloud Run service to the newly created service account.
- 4Create the Cloud Pub/Sub push subscription specifying the Cloud Run service URL and attaching the service account.
Cevap
The correct sequence starts by creating a dedicated service account for the Pub/Sub push identity, deploying the target Cloud Run service with unauthenticated access disabled, binding the `roles/run.invoker` role on the Cloud Run service to the service account, and finally creating the Pub/Sub push subscription configured with the service endpoint and identity.
To build a secure push integration between Pub/Sub and Cloud Run, the identity components and service perimeter must be established in logical order: first create the principal (service account), then provision the resource and endpoint (`--no-allow-unauthenticated`), assign authorization (`roles/run.invoker`), and lastly create the integration object (Pub/Sub push subscription).
Adım Adım Çözüm
Anahtar Kavram
Securing Cloud Run Services with Pub/Sub Push Authentication and IAM Roles