Skip to content

Commit

Permalink
added spot capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed May 2, 2024
1 parent d98b463 commit f448447
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ locals {
capacity_providers = var.image_build_details["buildx"] == "true" && can(regexall("^arm64", var.image_build_details["platforms"])) ? [
{
capacity_provider = "${var.ecs_cluster}-native-scaling"
weight = 1
weight = 2
},
{
capacity_provider = "${var.ecs_cluster}-native-spot-scaling"
weight = var.capacity_provider_spot_tasks_weight
}
] : [
{
capacity_provider = "${var.ecs_cluster}-native-scaling"
weight = 1
},
weight = 2
},
{
capacity_provider = "${var.ecs_cluster}-native-spot-scaling"
weight = var.capacity_provider_spot_tasks_weight
}
]
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,10 @@ variable "image_build_details" {
"buildx" = "false",
"platforms" = ""
}
}

variable "capacity_provider_spot_tasks_weight" {
default = 1
type = number
description = "Weight "
}

0 comments on commit f448447

Please sign in to comment.