a968d6df by Volodymyr Tsap

Modify the autoscale depend

1 parent d0c6c901
...@@ -25,7 +25,7 @@ resource "aws_launch_configuration" "launch-xpdays" { ...@@ -25,7 +25,7 @@ resource "aws_launch_configuration" "launch-xpdays" {
25 ## Add Autoscaling group 25 ## Add Autoscaling group
26 resource "aws_autoscaling_group" "asg-xpdays" { 26 resource "aws_autoscaling_group" "asg-xpdays" {
27 lifecycle { create_before_destroy = true } 27 lifecycle { create_before_destroy = true }
28 name = "asg-${aws_launch_configuration.launch-xpdays.name}-${var.instance_suffix[count.index]}" 28 name = "asg-${var.instance_suffix[count.index]}-${element(aws_launch_configuration.launch-xpdays.*.name, count.index)}"
29 29
30 desired_capacity = "${lookup(var.instance_count_xpdays_desired, var.environment)}" 30 desired_capacity = "${lookup(var.instance_count_xpdays_desired, var.environment)}"
31 max_size = "${lookup(var.instance_count_xpdays_max, var.environment)}" 31 max_size = "${lookup(var.instance_count_xpdays_max, var.environment)}"
......
...@@ -48,8 +48,8 @@ asg_enabled_metrics = [ "GroupDesiredCapacity", "GroupPendingInstances", "GroupI ...@@ -48,8 +48,8 @@ asg_enabled_metrics = [ "GroupDesiredCapacity", "GroupPendingInstances", "GroupI
48 "GroupStandbyInstances", "GroupTotalInstances", "GroupMinSize" , "GroupTerminatingInstances" ] 48 "GroupStandbyInstances", "GroupTotalInstances", "GroupMinSize" , "GroupTerminatingInstances" ]
49 49
50 # 50 #
51 instance_suffix = ["blue"] 51 #instance_suffix = ["blue"]
52 #instance_suffix = ["blue","green"] 52 instance_suffix = ["blue","green"]
53 53
54 54
55 instance_count_xpdays_desired = { 55 instance_count_xpdays_desired = {
......