Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion Modules/AWS/ALB/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "aws_alb_target_group" "alb_target_group" {
protocol = "HTTP"
vpc_id = var.vpc_id
target_type = "instance"
deregistration_delay = 5
deregistration_delay = 30

health_check {
path = var.alb_health_check_path
Expand Down
25 changes: 18 additions & 7 deletions Modules/AWS/ECS/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ resource "aws_ecs_task_definition" "ecs_task_definition" {

container_definitions = jsonencode([
{
name = "dutymate-container",
image = "${var.ecr_repository_url}:latest",
memory = 768,
cpu = 512,
essential = true,
name = "dutymate-container",
image = "${var.ecr_repository_url}:latest",
cpu = 512,
memoryReservation = 512,
memory = 768,
essential = true,
portMappings = [{
containerPort = 8080,
hostPort = 8080,
Expand Down Expand Up @@ -59,6 +60,16 @@ resource "aws_ecs_service" "ecs_service" {
deployment_minimum_healthy_percent = 50
deployment_maximum_percent = 100

capacity_provider_strategy {
capacity_provider = aws_ecs_capacity_provider.capacity_provider.name
base = 2
weight = 1
}

placement_constraints {
type = "distinctInstance"
}

load_balancer {
target_group_arn = var.alb_target_group_arn
container_port = 8080
Expand Down Expand Up @@ -143,10 +154,10 @@ resource "aws_ecs_capacity_provider" "capacity_provider" {
managed_termination_protection = "ENABLED"

managed_scaling {
status = "ENABLED"
target_capacity = 90
maximum_scaling_step_size = 5
minimum_scaling_step_size = 1
status = "ENABLED"
target_capacity = 100
}
}

Expand Down