#gcp #cloudrun #auth Did anyone was able to setup ...
# google-cloud
r
#gcp #cloudrun #auth Did anyone was able to setup value for
Authentication
in
gcp.cloudrunv2.Service
from
require authentication
to
Allow unauthenticated invocations
?
t
Hi! I believe I have the same question that was asked here a while back! I would like to create a Cloud Function gen2 that allows unauthenticated HTTP invocations. I cannot find a Pulumi option to change this parameter. In the Google Cloud Console, the option appears (a) when you create the cloud function or (b) in the underlying/associated Cloud Run Service. Pulumi docs don’t describe a way to set this with either service, nor does “pulumi import” of an unauthenticated function suggest any parameters that have an effect.
b
do you know the underlying API call to do this? that property may not have been plumbed through to the provider
t
Answered my own question.
I needed to create this object
Copy code
my_service_policy = gcp.cloudrunv2.ServiceIamPolicy(
    "my_service_policy",
    location=gcp_region_name,
    name=my_function.service_config.service,
    policy_data=json.dumps({
        "bindings": [
            {
                "members": [
                    "allUsers"
                ],
                "role": "roles/run.invoker"
            }
        ]
    }),
    project=gcp_project_name,
)
Note it is a Cloud Run resource not a Cloud Functions resource. Took a little while to track that down. Hope this helps someone else, thanks
r
I will check, thanks!