Skip to content

Commit

Permalink
Merge pull request #11 from hashicorp-modules/f-roll-asgs
Browse files Browse the repository at this point in the history
Roll ASGs upon LC change
  • Loading branch information
bensojona authored May 3, 2018
2 parents 168b96a + 4294cbd commit 26f620c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ module "nomad_lb_aws" {
resource "aws_autoscaling_group" "hashistack" {
count = "${var.create ? 1 : 0}"

name_prefix = "${format("%s-hashistack-", var.name)}"
name_prefix = "${aws_launch_configuration.hashistack.name}"
launch_configuration = "${aws_launch_configuration.hashistack.id}"
vpc_zone_identifier = ["${var.subnet_ids}"]
max_size = "${var.count != -1 ? var.count : length(var.subnet_ids)}"
min_size = "${var.count != -1 ? var.count : length(var.subnet_ids)}"
min_elb_capacity = "${var.count != -1 ? var.count : length(var.subnet_ids)}"
desired_capacity = "${var.count != -1 ? var.count : length(var.subnet_ids)}"
default_cooldown = 30
force_delete = true
Expand All @@ -239,4 +240,8 @@ resource "aws_autoscaling_group" "hashistack" {
),
var.tags_list
)}"]

lifecycle {
create_before_destroy = true
}
}

0 comments on commit 26f620c

Please sign in to comment.