Skip to content

Commit 214208f

Browse files
authored
fix: exports the cloudrun cpu_idle var and default to true (#8)
See the Terraform docs for why this is required: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service#cpu_idle-1
1 parent dbcb63b commit 214208f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cloudrun/module/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ resource "google_cloud_run_v2_service" "service" {
9999
containers {
100100
image = "${local.service_image_url}@${docker_registry_image.push.sha256_digest}"
101101
resources {
102+
cpu_idle = var.cpu_idle
102103
limits = merge(
103104
{
104105
cpu = var.cpus

cloudrun/module/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ variable "memory_mb" {
2222
default = 512
2323
}
2424

25+
variable "cpu_idle" {
26+
description = "Determines whether CPU is only allocated during requests"
27+
type = bool
28+
default = true
29+
}
30+
2531
variable "cpus" {
2632
description = "The amount of cpus to allocate to the CloudRun service"
2733
type = number

0 commit comments

Comments
 (0)