Skip to content

Commit cd31b74

Browse files
committed
fix: add comment in terraform code
1 parent 0f15db3 commit cd31b74

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/runners/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ resource "aws_launch_template" "runner" {
206206
)
207207
}
208208

209+
# We avoid including the "spot-instances-request" tag_specifications block when on_demand_failover_for_errors is defined,
210+
# because when using on-demand fallback, the spot instance request resource is not created and thus the tags would not apply.
211+
# Additionally, tagging spot requests via the CreateFleetCommand in the Lambda function does not work as expected,
212+
# so we rely on Terraform to manage these tags only when spot is exclusively used without on-demand failover.
209213
dynamic "tag_specifications" {
210214
for_each = var.instance_target_capacity_type == "spot" && var.enable_on_demand_failover_for_errors == null ? [1] : [] # Include the block only if the value is "spot" and on_demand_failover_for_errors is not enabled
211215
content {

0 commit comments

Comments
 (0)