-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws_ecs_service.tf
More file actions
46 lines (41 loc) · 1.22 KB
/
aws_ecs_service.tf
File metadata and controls
46 lines (41 loc) · 1.22 KB
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
resource "aws_ecs_service" "ecs-codedeploy" {
cluster = aws_ecs_cluster.ecs-codedeploy.id
deployment_maximum_percent = 200
deployment_minimum_healthy_percent = 100
desired_count = 2
enable_ecs_managed_tags = false
health_check_grace_period_seconds = 0
launch_type = "FARGATE"
name = "${var.app-name}-service"
platform_version = "1.3.0"
scheduling_strategy = "REPLICA"
tags = {}
task_definition = var.app-name
deployment_controller {
type = "CODE_DEPLOY"
}
load_balancer {
container_name = var.app-name
container_port = 80
target_group_arn = aws_lb_target_group.ecs-codedeploy-x.arn
}
network_configuration {
assign_public_ip = true
security_groups = [
aws_security_group.alb-sg.id
]
subnets = [
aws_subnet.ecs-codedeploy-private-subnet-a.id,
aws_subnet.ecs-codedeploy-private-subnet-c.id
]
}
lifecycle {
ignore_changes = [
task_definition,
load_balancer,
]
}
depends_on = [
aws_lb_target_group.ecs-codedeploy-x
]
}