sparse-intern-71089
06/29/2020, 5:35 AMbroad-breakfast-39210
06/29/2020, 5:37 AMbroad-breakfast-39210
06/29/2020, 6:09 AMbroad-dog-22463
06/29/2020, 8:31 AMbroad-breakfast-39210
06/29/2020, 8:41 AMmember: "allUsers"
is not enough anymore to be truly publicbroad-breakfast-39210
06/29/2020, 8:41 AMbroad-dog-22463
06/29/2020, 8:52 AMbroad-dog-22463
06/29/2020, 8:52 AMbroad-dog-22463
06/29/2020, 8:53 AMbroad-breakfast-39210
06/29/2020, 1:59 PMbroad-dog-22463
06/29/2020, 2:00 PMbroad-breakfast-39210
06/29/2020, 2:03 PMallUsers
or ALLOW_ALL
permissions, but with a function created by Pulumi it's impossible to get the Allow Unauthenticated
flag , this flag can only be set with gcloud CLI and it's actually not reflected in the JSON payload for the REST APIbroad-breakfast-39210
06/29/2020, 2:04 PMgcloud
and --allow-unauthenticated
flag, then it's finebroad-breakfast-39210
06/29/2020, 2:05 PMmember
or IAM permissionsbroad-breakfast-39210
06/29/2020, 2:06 PMallUsers
so in theory it's public but somehow this flag is required to be able to invoke it publiclybroad-breakfast-39210
06/29/2020, 2:06 PMbroad-breakfast-39210
06/29/2020, 2:07 PMfxn = cloudfunctions.Function(
"add_post_to_feeds",
entry_point="add_post_to_feeds",
environment_variables=config_values,
region="us-central1",
runtime="python37",
source_archive_bucket=bucket.name,
source_archive_object=source_archive_object.name,
trigger_http=True)
invoker = cloudfunctions.FunctionIamMember(
"invoker",
project=fxn.project,
region=fxn.region,
cloud_function=fxn.name,
role="roles/cloudfunctions.invoker",
member="allUsers",
)
# Export the DNS name of the bucket and the cloud function URL.
pulumi.export("bucket_name", bucket.url)
pulumi.export("fxn_url", fxn.https_trigger_url)
broad-dog-22463
06/29/2020, 2:09 PMbroad-dog-22463
06/29/2020, 2:12 PMbroad-dog-22463
06/29/2020, 2:12 PMbroad-breakfast-39210
06/29/2020, 2:20 PMbroad-breakfast-39210
06/29/2020, 2:21 PMbroad-dog-22463
06/29/2020, 2:23 PMbroad-breakfast-39210
06/29/2020, 3:27 PMbroad-breakfast-39210
06/30/2020, 2:30 AMgcloud
in ourder to enable that flag 😞broad-breakfast-39210
06/30/2020, 2:30 AMserverless
framework might have similar issues to Pulumi and Terraform with this https://forum.serverless.com/t/setting-iam-policies-for-google-http-functions-since-all-new-gcloud-http-functions-after-nov-1-2019-will-default-private/8686broad-dog-22463
06/30/2020, 10:20 AMbroad-dog-22463
06/30/2020, 10:21 AMbroad-dog-22463
06/30/2020, 10:21 AMbroad-breakfast-39210
07/02/2020, 2:04 AMbroad-breakfast-39210
07/02/2020, 4:07 AMCloud Functions Admin
role in IAM so it couldn't properly create the invoker.
The weird thing is that Pulumi didn't show any errors about this until today for me, it was creating the function and invoker but I was getting 403 and redeploying a function with gcloud
CLI would solve the problem...
But today Pulumi started failing to create the invoker specifically so this is how I've found by trial and error that adding that IAM role solves the problem...broad-dog-22463
07/02/2020, 8:15 AMbroad-breakfast-39210
07/02/2020, 8:42 AMbroad-dog-22463
07/02/2020, 8:42 AM