Skip to content

Commit f0e071f

Browse files
authored
Merge branch 'main' into specify-instance-max
2 parents c58c9fd + 578d6e5 commit f0e071f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

terraform/modules/autoscaler-functions/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ resource "google_cloudfunctions2_function" "poller_function" {
121121
service_config {
122122
max_instance_count = var.poller_max_instance_count
123123
available_memory = "256M"
124+
available_cpu = var.poller_function_available_cpu
124125
ingress_settings = "ALLOW_INTERNAL_AND_GCLB"
125126
service_account_email = var.poller_sa_email
126127
}
@@ -153,6 +154,7 @@ resource "google_cloudfunctions2_function" "scaler_function" {
153154
service_config {
154155
max_instance_count = var.scaler_max_instance_count
155156
available_memory = "256M"
157+
available_cpu = var.scaler_function_available_cpu
156158
ingress_settings = "ALLOW_INTERNAL_AND_GCLB"
157159
service_account_email = var.scaler_sa_email
158160
}

terraform/modules/autoscaler-functions/variables.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,23 @@ variable "poller_max_instance_count" {
6767
type = number
6868
default = null
6969
}
70+
71+
variable "poller_function_available_cpu" {
72+
type = number
73+
default = null
74+
description = "The amount of available CPU for the poller function. Unset/null will allow Cloud Run to default based on Memory."
75+
validation {
76+
condition = var.poller_function_available_cpu == null ? true : var.poller_function_available_cpu >= 0.08
77+
error_message = "The minimum value for poller_function_available_cpu is 0.08."
78+
}
79+
}
80+
81+
variable "scaler_function_available_cpu" {
82+
type = number
83+
default = null
84+
description = "The amount of available CPU for the scaler function. Unset/null will allow Cloud Run to default based on Memory."
85+
validation {
86+
condition = var.scaler_function_available_cpu == null ? true : var.scaler_function_available_cpu >= 0.08
87+
error_message = "The minimum value for scaler_function_available_cpu is 0.08."
88+
}
89+
}

0 commit comments

Comments
 (0)