-
Notifications
You must be signed in to change notification settings - Fork 0
/
asg.tf
30 lines (24 loc) · 886 Bytes
/
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
resource "aws_autoscaling_group" "asg" {
name = "vault_asg_${ var.env }"
launch_configuration = "${ aws_launch_configuration.lc.name }"
vpc_zone_identifier = ["${ var.ec2_subnets }"]
target_group_arns = ["${ aws_alb_target_group.tg.arn }"]
min_size = "${ var.asg_min_size }"
max_size = "${ var.asg_max_size }"
desired_capacity = "${ var.asg_desired_capacity }"
# Don't use ELB as the health check because we do not want
# AWS to start cycling instances when Vault is unhealthy,
# since our health check will only have one healthy at a time
health_check_type = "EC2"
health_check_grace_period = 300
wait_for_capacity_timeout = 0
termination_policies = ["OldestInstance"]
tags = [{
key = "Name"
value = "vault"
propagate_at_launch = true
}]
tags = [
"${ var.tags_asg }",
]
}