https://pulumi.com logo
#google-cloud
Title
# google-cloud
r

refined-rose-1179

06/01/2023, 7:20 AM
#gcp #cloudrun #auth Did anyone was able to setup value for
Authentication
in
gcp.cloudrunv2.Service
from
require authentication
to
Allow unauthenticated invocations
?
t

thousands-toothbrush-98776

08/25/2023, 9:19 PM
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

billowy-army-68599

08/25/2023, 9:44 PM
do you know the underlying API call to do this? that property may not have been plumbed through to the provider
t

thousands-toothbrush-98776

08/25/2023, 10:03 PM
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

refined-rose-1179

09/04/2023, 8:40 AM
I will check, thanks!