-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
36 lines (29 loc) · 898 Bytes
/
main.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
resource "aws_ecs_cluster" "main" {
name = "${local.identifier}-cluster"
setting {
name = "containerInsights"
value = "enabled"
}
}
resource "aws_ecs_capacity_provider" "main" {
name = "${local.identifier}-ecs-ec2"
auto_scaling_group_provider {
auto_scaling_group_arn = aws_autoscaling_group.ecs.arn
managed_termination_protection = "DISABLED"
managed_scaling {
maximum_scaling_step_size = 2
minimum_scaling_step_size = 1
status = "ENABLED"
target_capacity = 100
}
}
}
resource "aws_ecs_cluster_capacity_providers" "main" {
cluster_name = aws_ecs_cluster.main.name
capacity_providers = [aws_ecs_capacity_provider.main.name]
default_capacity_provider_strategy {
capacity_provider = aws_ecs_capacity_provider.main.name
base = 1
weight = 100
}
}