hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Cloudfunctions v2 example contains incorrect iam policy #15200

Open nbrys opened 1 year ago

nbrys commented 1 year ago

Community Note

Terraform Version

1.3.3

Affected Resource(s)

https://github.com/GoogleCloudPlatform/terraform-google-cloud-functions/blob/main/main.tf

Terraform Configuration Files

resource "google_cloudfunctions2_function_iam_member" "invokers" {

According to the documentation, for cloudfunctions v2 you need to assigned the roles/run.invoker role for custom SA or invokers. By just assigning the cloudfunctions.invoker role, you still get permission denied when invoking the function.

see also: https://cloud.google.com/functions/docs/securing/authenticating#:~:text=Cloud%20Functions%20(2nd%20gen)%3A

edwardmedia commented 1 year ago

b/291648885