Skip to content

Commit cfe96c1

Browse files
committed
concurrency on
1 parent c07288b commit cfe96c1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

terraform/modules/cloud-function/main.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ resource "google_cloudfunctions2_function" "function" {
2727
}
2828
}
2929
}
30-
30+
3131
service_config {
3232
all_traffic_on_latest_revision = true
33-
available_memory = var.environment == "prod" ? "4Gi" : var.available_memory_mb
33+
available_memory = var.available_memory_mb
3434
ingress_settings = var.ingress_settings
3535

3636
environment_variables = var.environment_variables
3737

3838
min_instance_count = var.min_instances
3939
max_instance_count = var.max_instances
40-
timeout_seconds = var.timeout
40+
timeout_seconds = var.timeout
41+
max_instance_request_concurrency = var.max_instance_request_concurrency
4142
service_account_email = var.service_account_email
4243
}
4344

terraform/modules/cloud-function/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ variable "min_instances" {
6363
type = number
6464
default = 0
6565
}
66+
variable "max_instance_request_concurrency" {
67+
description = "(Optional) The limit on the maximum number of requests that an instance can handle simultaneously. This can be used to control costs when scaling. Defaults to 1."
68+
type = number
69+
default = 5
70+
}
6671
variable "environment_variables" {
6772
description = "environment_variables"
6873
default = {}

0 commit comments

Comments
 (0)