From acc056a8acae5936b7e92065007ac93530c01d23 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Tue, 9 May 2023 16:02:30 +0900 Subject: [PATCH] Add Cloud Run resources requests (#67) Signed-off-by: Yu ISHIKAWA --- terraform/module/google_cloud_run_service.tf | 4 ++++ terraform/module/variables.tf | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/terraform/module/google_cloud_run_service.tf b/terraform/module/google_cloud_run_service.tf index af0748b..a5a844a 100644 --- a/terraform/module/google_cloud_run_service.tf +++ b/terraform/module/google_cloud_run_service.tf @@ -12,6 +12,10 @@ resource "google_cloud_run_service" "dbt_artifact_loader" { containers { image = var.docker_image + resources { + requests = var.cloud_run_resources_requests + } + env { name = "ENV_FILE" value = ".env/.env.prod" diff --git a/terraform/module/variables.tf b/terraform/module/variables.tf index ccf34f5..857d935 100644 --- a/terraform/module/variables.tf +++ b/terraform/module/variables.tf @@ -120,3 +120,15 @@ variable "cloud_run_service_name" { type = string default = "dbt-artifacts-loader" } + +variable "cloud_run_resources_requests" { + description = "The resources of Cloud Run" + type = object({ + cpu = string + memory = string + }) + default = { + cpu = "1" + memory = "512Mi" + } +}