-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
autoscaling_group.tf
38 lines (32 loc) · 1.03 KB
/
autoscaling_group.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
resource "aws_autoscaling_group" "elasticsearch" {
name = "${var.service_name}-${var.environment}-elasticsearch"
max_size = "${var.elasticsearch_max_instances}"
min_size = "${var.elasticsearch_min_instances}"
desired_capacity = "${var.elasticsearch_desired_instances}"
default_cooldown = 30
force_delete = true
launch_template = {
id = "${aws_launch_template.elasticsearch.id}"
version = "$$Latest"
}
vpc_zone_identifier = ["${data.aws_subnet_ids.all_subnets.ids}"]
load_balancers = ["${aws_elb.elasticsearch_elb.*.id}"]
tag {
key = "Name"
value = "${var.service_name}-${var.environment}-elasticsearch"
propagate_at_launch = true
}
tag {
key = "team"
value = "${var.service_name}"
propagate_at_launch = true
}
tag {
key = "env"
value = "${var.environment}"
propagate_at_launch = true
}
lifecycle {
create_before_destroy = true
}
}