Skip to content

Commit a95d608

Browse files
committed
feat: add max_active_builds variable with validation for concurrent builds
1 parent f4de72c commit a95d608

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

infrastructure/terraform/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,21 @@ variable "sqs_max_receive_count" {
203203
type = number
204204
default = 3
205205
}
206+
207+
variable "max_active_builds" {
208+
description = <<-EOT
209+
Maximum number of concurrently active builds (queued + in-flight).
210+
Requests that would exceed this limit receive HTTP 429.
211+
Each active build may launch up to 2 EC2 Spot instances (one per architecture),
212+
so this cap directly bounds worst-case concurrent EC2 costs.
213+
214+
Default: 10 (= up to 20 simultaneous Spot instances)
215+
EOT
216+
type = number
217+
default = 10
218+
219+
validation {
220+
condition = var.max_active_builds >= 1 && var.max_active_builds <= 100
221+
error_message = "max_active_builds must be between 1 and 100."
222+
}
223+
}

0 commit comments

Comments
 (0)