Hi,
I have done a simple google cloud function to receive notifications or alerts from GCP using the webhook notification channel, but is not getting any alert or http request. Do I need to give access to a monitoring service account or something?
Thanks
Hi @friveros – to confirm, if you’ve set up a Webhook notification following these steps you also need to setup your Cloud Function to receive requests and may need to pass authentication to your Cloud Function. Is your Cloud Function able to be invoked when you manually test it?
Thanks,
Kyle
Hi Kyle,
Yes I have followed all the steps, but I think I had misunderstood the concept of public endpoint. Since I have created the cloud function public but with Authentication (Require Authentication: Manage Authorised users with Cloud IAM). So under that concept I thought that is still public endpoint, but it seems is not.
So please correct me if I am wrong but Monitoring needs that the cloud function had a public endpoint and with “Allow unauthenticated invocations” in order to be called right?
Based on that, is there a way to have the Cloud function with authentication with Cloud IAM to be called by Monitoring?
Thanks in advance!
@friveros , Basically, you should either (1) create a public HTTP function setting “allow unauthenticated” or (2) grant cloudfunctions.invoker to monitoring service account (service-${PROJECT_NUMBER})@gcp-sa-monitoring-notification.iam.gserviceaccount.com".
Case you’re sending these notifications via Pub/Sub, you need to associate a service account to Pub/Sub subscriptions and also grant cloundsfunctions.invoker role to this service account.