Hi,
I have a Cloud Function as the destination for an Eventarc Trigger. The Cloud Function requires authentication.
I created a service account for the trigger but it fails if I give it Cloud Functions Invoker permission on the Cloud Function.
The error logged in the CF:
The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header …
If I remove the Cloud Functions Invoker permission and add Cloud Run Invoker permission on the CF’s Cloud Run service then it succeeds.
Expect that the Cloud Functions Invoker permission would be the correct permission to apply.
My Eventarc Trigger details:
Name: my-trigger
Region: us-central1
Service account: my-trigger@<project_id>.iam.gserviceaccount.com
Event provider: Cloud Pub/Sub
Event type: google.cloud.pubsub.topic.v1.messagePublished
Event data content type: No value
Topic: projects/<project_id>/topics/my-topic
Infrastructure: Cloud Pub/Sub
Destination platform: Cloud Functions
Destination: my-cloud-function (us-central1) [And this destination links to the Cloud Function]
Error conditions: None
Encryption: Events encrypted using Google-managed encryption keys
