Skip to content

Commit a28edc7

Browse files
committed
allow operations api to run unauthenticated
1 parent 3fd13f4 commit a28edc7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

infra/functions-python/main.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,23 @@ resource "google_cloud_run_service_iam_member" "tokens_cloud_run_invoker" {
653653
member = "allUsers"
654654
}
655655

656+
# Allow Operations API function to be called by all users
657+
resource "google_cloudfunctions2_function_iam_member" "operations_api_invoker" {
658+
project = var.project_id
659+
location = var.gcp_region
660+
cloud_function = google_cloudfunctions2_function.operations_api.name
661+
role = "roles/cloudfunctions.invoker"
662+
member = "allUsers"
663+
}
664+
665+
resource "google_cloud_run_service_iam_member" "operastions_cloud_run_invoker" {
666+
project = var.project_id
667+
location = var.gcp_region
668+
service = google_cloudfunctions2_function.operations_api.name
669+
role = "roles/run.invoker"
670+
member = "allUsers"
671+
}
672+
656673
# Permissions on the service account used by the function and Eventarc trigger
657674
resource "google_project_iam_member" "invoking" {
658675
project = var.project_id

0 commit comments

Comments
 (0)