-
Notifications
You must be signed in to change notification settings - Fork 0
/
global-ecs-service.tf
63 lines (52 loc) · 1.42 KB
/
global-ecs-service.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
resource "aws_ecs_service" "default" {
name = "default"
cluster = aws_ecs_cluster.cluster.id
task_definition = aws_ecs_task_definition.task_definition.arn
desired_count = 1
iam_role = aws_iam_role.ecs-service-role.name
depends_on = [aws_lb_target_group.global_alb_tg]
ordered_placement_strategy {
type = "binpack"
field = "cpu"
}
load_balancer {
target_group_arn = aws_lb_target_group.global_alb_tg.arn
container_name = "Nginx"
container_port = 8888
}
enable_ecs_managed_tags = true
propagate_tags = "SERVICE"
tags = {
Stack = "devser"
ServiceType = "Default"
}
lifecycle {
create_before_destroy = true
}
}
resource "aws_ecs_service" "pma" {
name = "phpmyadmin"
cluster = aws_ecs_cluster.cluster.id
task_definition = aws_ecs_task_definition.pma_task_definition.arn
desired_count = 1
iam_role = aws_iam_role.ecs-service-role.name
depends_on = [aws_lb_target_group.pma_alb_tg]
ordered_placement_strategy {
type = "binpack"
field = "cpu"
}
load_balancer {
target_group_arn = aws_lb_target_group.pma_alb_tg.arn
container_name = "phpmyadmin"
container_port = 80
}
enable_ecs_managed_tags = true
propagate_tags = "SERVICE"
tags = {
Stack = "devser"
ServiceType = "Default"
}
lifecycle {
create_before_destroy = true
}
}