Skip to content
Open
Show file tree
Hide file tree
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
46 changes: 23 additions & 23 deletions docanalytics-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions infra/ecs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
resource "aws_ecs_cluster" "main" { name = "docanalytics-cluster" }

resource "aws_ecs_cluster_capacity_providers" "main" {
cluster_name = aws_ecs_cluster.main.name
capacity_providers = ["FARGATE_SPOT"]

default_capacity_provider_strategy {
capacity_provider = "FARGATE_SPOT"
weight = 1
base = 1
}
}

# Initial task defs — GH Actions registers new revisions per deploy,
# so services ignore task_definition drift (see lifecycle blocks).
resource "aws_ecs_task_definition" "api" {
Expand Down Expand Up @@ -59,7 +70,11 @@ resource "aws_ecs_service" "api" {
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.api.arn
desired_count = 1
launch_type = "FARGATE"
capacity_provider_strategy {
capacity_provider = "FARGATE_SPOT"
weight = 1
base = 1
}
network_configuration {
subnets = var.private_subnets
security_groups = [aws_security_group.task.id]
Expand All @@ -79,7 +94,11 @@ resource "aws_ecs_service" "web" {
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.web.arn
desired_count = 1
launch_type = "FARGATE"
capacity_provider_strategy {
capacity_provider = "FARGATE_SPOT"
weight = 1
base = 1
}
network_configuration {
subnets = var.private_subnets
security_groups = [aws_security_group.task.id]
Expand Down
Loading