-
Notifications
You must be signed in to change notification settings - Fork 8
/
asg.tf
36 lines (31 loc) · 837 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
31
32
33
34
35
36
resource "aws_autoscaling_group" "bastion" {
name_prefix = var.name
vpc_zone_identifier = var.private_subnets
desired_capacity = "1"
min_size = "1"
max_size = "1"
health_check_grace_period = "60"
health_check_type = "ELB"
force_delete = false
wait_for_capacity_timeout = 0
target_group_arns = [aws_lb_target_group.bastion.arn]
launch_template {
id = aws_launch_template.bastion.id
version = "$Latest"
}
enabled_metrics = [
"GroupInServiceInstances",
"GroupTotalInstances",
]
tag {
key = "Name"
value = var.name
propagate_at_launch = "true"
}
instance_refresh {
strategy = "Rolling"
}
lifecycle {
create_before_destroy = true
}
}