Skip to content

Commit 0301339

Browse files
committed
feat: configure ingress settings and increase Cloud Run service resource limits and concurrency
Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
1 parent 03e052e commit 0301339

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

terraform/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module "endpoints" {
2828
service_name = "report-api"
2929
region = var.region
3030
min_instances = var.environment == "prod" ? 1 : 0
31+
ingress_settings = var.environment == "prod" ? "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" : "INGRESS_TRAFFIC_ALL"
32+
3133
environment_variables = {
3234
"PROJECT" = var.project
3335
"DATABASE" = "${var.project_database}prod" // TODO: Update this to use ${var.environment}

terraform/run-service/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variable "available_memory" {
2929
description = "The amount of memory for the Cloud Function"
3030
}
3131
variable "available_cpu" {
32-
default = "1"
32+
default = "2"
3333
type = string
3434
description = "The amount of CPU for the Cloud Function"
3535
}
@@ -39,7 +39,7 @@ variable "ingress_settings" {
3939
description = "String value that controls what traffic can reach the function. Check ingress documentation to see the impact of each settings value. Changes to this field will recreate the cloud function."
4040
}
4141
variable "timeout" {
42-
default = "60s"
42+
default = "120s"
4343
type = string
4444
description = "Timeout for the service. Default value is 60 seconds. Cannot be more than 540 seconds."
4545
}
@@ -56,7 +56,7 @@ variable "min_instances" {
5656
variable "max_instance_request_concurrency" {
5757
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."
5858
type = number
59-
default = 80
59+
default = 100
6060
}
6161
variable "environment_variables" {
6262
description = "environment_variables"

0 commit comments

Comments
 (0)