Create a publicly accessible v2 Cloud Function

Hi,

I’m trying to deploy a V2 Google Cloud Function (i.e. the Cloud Run variant). This cloud function must be publicly accessible, however the examples I’ve found don’t see to work:

Any help is appreciated.

It looks like the basic approach (granting roles/run.invoker to allUsers on the IAM permissions, and setting the ingress to ALLOW_ALL on the function itself) there should work.

I think you probably need to use cloudfunctions2_function_iam instead of google_cloud_run_service_iam_member. This may have been the way to define it at one point (as cloudrun is what is underneath gen2 cloud functions), or it might be a typo.

I think that will fix it, but it would be helpful to include a sanitized version of your config so that it’s easier to understand the error you’re getting.