-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathecs_services.tf
48 lines (39 loc) · 1.17 KB
/
ecs_services.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
resource "aws_ecs_service" "traefik" {
name = "traefik"
depends_on = [aws_lb_target_group.traefik]
cluster = aws_ecs_cluster.traefik.id
task_definition = aws_ecs_task_definition.traefik.arn
desired_count = 1
launch_type = "FARGATE"
load_balancer {
target_group_arn = aws_lb_target_group.traefik_api.arn
container_name = "traefik"
container_port = 8080
}
load_balancer {
target_group_arn = aws_lb_target_group.traefik.arn
container_name = "traefik"
container_port = 80
}
network_configuration {
subnets = module.vpc.public_subnets
security_groups = [aws_security_group.traefik_ecs.id]
assign_public_ip = true
}
}
resource "aws_ecs_service" "whoami" {
name = "whoami"
cluster = aws_ecs_cluster.traefik.id
task_definition = aws_ecs_task_definition.whoami.arn
desired_count = 1
launch_type = "FARGATE"
network_configuration {
subnets = module.vpc.public_subnets
security_groups = [aws_security_group.whoami.id]
assign_public_ip = true
}
}
resource "aws_cloudwatch_log_group" "traefik" {
name = "traefik-logs"
retention_in_days = 1
}