From c548779f1e4e65c588093bb71d0621e431e48c85 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Tue, 13 Aug 2024 05:26:18 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20add=20cloud=20run=20under=20terr?= =?UTF-8?q?aform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- terraform/cloud-run.tf | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 terraform/cloud-run.tf diff --git a/terraform/cloud-run.tf b/terraform/cloud-run.tf new file mode 100644 index 0000000..36badcb --- /dev/null +++ b/terraform/cloud-run.tf @@ -0,0 +1,72 @@ +import { + id = "asia-northeast1/release" + to = google_cloud_run_v2_service.release +} + +resource "google_cloud_run_v2_service" "release" { + annotations = {} + client = "cloud-console" + client_version = null + custom_audiences = [] + description = null + ingress = "INGRESS_TRAFFIC_ALL" + labels = {} + launch_stage = "GA" + location = "asia-northeast1" + name = "release" + project = "lumos-profile-management" + template { + annotations = {} + encryption_key = null + execution_environment = null + labels = { + commit-sha = "51388093213b127735a6253af62a08fcfb1276f8" + github_sha = "edb2df9aa77a4294d8c4475cc2e733fc38edc011" + managed-by = "github-actions" + } + max_instance_request_concurrency = 80 + revision = null + service_account = "938038185918-compute@developer.gserviceaccount.com" + session_affinity = false + timeout = "300s" + containers { + args = [] + command = [] + depends_on = [] + image = "asia-northeast1-docker.pkg.dev/lumos-profile-management/main/nuxt3-release:latest" + name = "nuxt3-release-1" + working_dir = null + ports { + container_port = 8080 + name = "http1" + } + resources { + cpu_idle = true + limits = { + cpu = "1000m" + memory = "512Mi" + } + startup_cpu_boost = true + } + startup_probe { + failure_threshold = 1 + initial_delay_seconds = 0 + period_seconds = 240 + timeout_seconds = 240 + tcp_socket { + port = 8080 + } + } + } + scaling { + max_instance_count = 100 + min_instance_count = 0 + } + } + traffic { + percent = 100 + revision = null + tag = null + type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" + } +}