-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathecs.tf
40 lines (32 loc) · 967 Bytes
/
ecs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
resource "aws_ecs_service" "service" {
name = "SVC-${var.projectName}"
cluster = aws_ecs_cluster.cluster.arn
task_definition = aws_ecs_task_definition.task.arn
desired_count = 1
deployment_minimum_healthy_percent = 100
deployment_maximum_percent = 200
network_configuration {
subnets = ["${var.subnet01}", "${var.subnet02}", "${var.subnet03}"]
security_groups = ["${aws_security_group.sg.id}"]
assign_public_ip = true
}
health_check_grace_period_seconds = 240
load_balancer {
target_group_arn = aws_lb_target_group.tg.arn
container_name = var.projectName
container_port = 9000
}
capacity_provider_strategy {
base = 1
capacity_provider = "FARGATE"
weight = 1
}
deployment_circuit_breaker {
enable = true
rollback = true
}
deployment_controller {
type = "ECS"
}
depends_on = [aws_lb.alb]
}