Skip to content

Commit 898b041

Browse files
committed
1 cpu
1 parent 136e5ca commit 898b041

File tree

6 files changed

+11
-28
lines changed

6 files changed

+11
-28
lines changed

terraform/dev/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ module "endpoints" {
140140
region = var.region
141141
service_account_email = var.google_service_account_cloud_functions
142142
service_account_api_gateway = var.google_service_account_api_gateway
143-
max_instances = var.max_instances
144143
min_instances = var.min_instances
145-
max_instance_request_concurrency = var.max_instance_request_concurrency
146144
environment_variables = {
147145
"PROJECT" = var.project
148146
"DATABASE" = var.project_database

terraform/dev/variables.tf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,8 @@ variable "google_service_account_api_gateway" {
2727
description = "Service account for API Gateway"
2828
}
2929

30-
variable "max_instances" {
31-
default = 10
32-
type = number
33-
description = "(Optional) The limit on the maximum number of function instances that may coexist at a given time."
34-
}
3530
variable "min_instances" {
3631
description = "(Optional) The limit on the minimum number of function instances that may coexist at a given time."
3732
type = number
38-
default = 1
39-
}
40-
variable "max_instance_request_concurrency" {
41-
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."
42-
type = number
43-
default = 10
33+
default = 1 # TODO: Update this to 0 after performance testing
4434
}

terraform/modules/cloud-function/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ variable "max_instances" {
6161
variable "min_instances" {
6262
description = "(Optional) The limit on the minimum number of function instances that may coexist at a given time."
6363
type = number
64-
default = 0
64+
default = 1
6565
}
6666
variable "max_instance_request_concurrency" {
6767
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."

terraform/modules/run-service/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ resource "google_cloudfunctions2_function" "function" {
3131
service_config {
3232
all_traffic_on_latest_revision = true
3333
available_memory = var.available_memory_mb
34+
available_cpu = var.available_cpu
3435
ingress_settings = var.ingress_settings
3536

3637
environment_variables = var.environment_variables

terraform/modules/run-service/variables.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ variable "available_memory_mb" {
2626
type = string
2727
description = "The amount of memory for the Cloud Function"
2828
}
29+
variable "available_cpu" {
30+
default = "1"
31+
type = string
32+
description = "The amount of CPU for the Cloud Function"
33+
}
2934
variable "ingress_settings" {
3035
type = string
3136
default = "ALLOW_ALL"
@@ -54,19 +59,19 @@ variable "service_account_api_gateway" {
5459
description = "API Gateway service account who can invoke this function. This is required!"
5560
}
5661
variable "max_instances" {
57-
default = 1
62+
default = 10
5863
type = number
5964
description = "(Optional) The limit on the maximum number of function instances that may coexist at a given time."
6065
}
6166
variable "min_instances" {
6267
description = "(Optional) The limit on the minimum number of function instances that may coexist at a given time."
6368
type = number
64-
default = 0
69+
default = 1
6570
}
6671
variable "max_instance_request_concurrency" {
6772
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."
6873
type = number
69-
default = 1
74+
default = 18
7075
}
7176
variable "environment_variables" {
7277
description = "environment_variables"

terraform/prod/variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,8 @@ variable "google_service_account_api_gateway" {
2626
type = string
2727
description = "Service account for API Gateway"
2828
}
29-
30-
variable "max_instances" {
31-
default = 5
32-
type = number
33-
description = "(Optional) The limit on the maximum number of function instances that may coexist at a given time."
34-
}
3529
variable "min_instances" {
3630
description = "(Optional) The limit on the minimum number of function instances that may coexist at a given time."
3731
type = number
3832
default = 1
3933
}
40-
variable "max_instance_request_concurrency" {
41-
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."
42-
type = number
43-
default = 5
44-
}

0 commit comments

Comments
 (0)