a968d6df by Volodymyr Tsap

Modify the autoscale depend

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