Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/service_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ def _get_secret(scope: Construct, id: str, name: str) -> sm.Secret:
)
],
),
# Ensure at least one on demand task and the remaining should be spot tasks
capacity_provider_strategies=[
ecs.CapacityProviderStrategy(
capacity_provider="FARGATE",
base=1, # At least 1 task will be run by FARGATE
),
ecs.CapacityProviderStrategy(
capacity_provider="FARGATE_SPOT",
weight=1, # The remain task will be run by FARGATE_SPOT
),
],
)

# Setup AutoScaling policy
Expand Down
Loading