Skip to content

Commit 686e4e9

Browse files
committed
Add IAM member for unauthenticated access and update ingress settings
1 parent b3bc41e commit 686e4e9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

terraform/modules/run-service/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ resource "google_cloud_run_v2_service_iam_member" "api_gw_variable_service_accou
9292
role = "roles/run.invoker"
9393
member = "serviceAccount:${var.service_account_api_gateway}"
9494
}
95+
96+
resource "google_cloud_run_v2_service_iam_member" "allow_unauthenticated" {
97+
project = var.project
98+
location = var.region
99+
name = data.google_cloud_run_service.run-service.name
100+
role = "roles/run.invoker"
101+
member = "allUsers"
102+
}

terraform/modules/run-service/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ variable "available_cpu" {
3333
}
3434
variable "ingress_settings" {
3535
type = string
36-
default = "ALLOW_ALL"
36+
default = "ALLOW_INTERNAL_AND_GCLB"
3737
description = "String value that controls what traffic can reach the function. Allowed values are ALLOW_ALL, ALLOW_INTERNAL_AND_GCLB and ALLOW_INTERNAL_ONLY. Check ingress documentation to see the impact of each settings value. Changes to this field will recreate the cloud function."
3838
}
3939
variable "vpc_connector_egress_settings" {

0 commit comments

Comments
 (0)