-
Notifications
You must be signed in to change notification settings - Fork 38
/
asg.tf
62 lines (54 loc) · 1.37 KB
/
asg.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
resource "aws_autoscaling_group" "main" {
count = var.ha_mode ? 1 : 0
name = var.name
max_size = 1
min_size = 1
desired_capacity = 1
health_check_type = "EC2"
vpc_zone_identifier = [var.subnet_id]
launch_template {
id = aws_launch_template.main.id
version = "$Latest"
}
dynamic "tag" {
for_each = lookup(var.tags, "Name", null) == null ? ["Name"] : []
content {
key = "Name"
value = var.name
propagate_at_launch = true
}
}
dynamic "tag" {
for_each = var.tags
content {
key = tag.key
value = tag.value
propagate_at_launch = false
}
}
enabled_metrics = [
"GroupMinSize",
"GroupMaxSize",
"GroupDesiredCapacity",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupStandbyInstances",
"GroupTerminatingInstances",
"GroupTotalInstances",
"GroupInServiceCapacity",
"GroupPendingCapacity",
"GroupStandbyCapacity",
"GroupTerminatingCapacity",
"GroupTotalCapacity",
"WarmPoolDesiredCapacity",
"WarmPoolWarmedCapacity",
"WarmPoolPendingCapacity",
"WarmPoolTerminatingCapacity",
"WarmPoolTotalCapacity",
"GroupAndWarmPoolDesiredCapacity",
"GroupAndWarmPoolTotalCapacity"
]
timeouts {
delete = "15m"
}
}