Skip to content

Instantly share code, notes, and snippets.

@endofcake
Last active August 20, 2018 23:54
Show Gist options
  • Save endofcake/e58f0b6ad2813f3d8aaa655c03bdf799 to your computer and use it in GitHub Desktop.
Save endofcake/e58f0b6ad2813f3d8aaa655c03bdf799 to your computer and use it in GitHub Desktop.
Blue/Green ASG rollout
resource "aws_autoscaling_group" "worker" {
# Force a redeployment when launch configuration changes.
# This will reset the desired capacity if it was changed due to
# autoscaling events.
name = "${aws_launch_configuration.worker.name}-asg"
min_size = 10
desired_capacity = 15
max_size = 25
health_check_type = "EC2"
launch_configuration = "${aws_launch_configuration.worker.name}"
vpc_zone_identifier = ["${aws_subnet.public.*.id}"]
# Required to redeploy without an outage.
lifecycle {
create_before_destroy = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment