Commit 434e4e25 authored by Chris Merrett's avatar Chris Merrett

Attempt lifecycle fix

parent 1f32b2d3
......@@ -148,7 +148,6 @@ resource "aws_security_group" "main" {
# Launch Configuration
#############################################################################################################
resource "aws_launch_configuration" "main" {
lifecycle { create_before_destroy = true }
name_prefix = "${var.name}-lc-"
image_id = "${var.ami}"
instance_type = "${var.instance_type}"
......@@ -158,13 +157,15 @@ resource "aws_launch_configuration" "main" {
root_block_device {
delete_on_termination = "true"
}
lifecycle {
create_before_destroy = true
}
}
#############################################################################################################
# Autoscaling Groups
#############################################################################################################
resource "aws_autoscaling_group" "main" {
lifecycle { create_before_destroy = true }
name = "${var.name}"
launch_configuration = "${aws_launch_configuration.main.name}"
load_balancers = ["${var.load_balancers}"]
......@@ -186,6 +187,9 @@ resource "aws_autoscaling_group" "main" {
value = "${aws_launch_configuration.main.name}"
propagate_at_launch = true
}
lifecycle {
create_before_destroy = true
}
}
#############################################################################################################
......@@ -193,7 +197,6 @@ resource "aws_autoscaling_group" "main" {
#############################################################################################################
resource "aws_autoscaling_policy" "scale_up" {
lifecycle { create_before_destroy = true }
name = "${var.name}-scale-up"
adjustment_type = "PercentChangeInCapacity"
scaling_adjustment = "${var.scale_up_scaling_adjustment}"
......@@ -202,7 +205,6 @@ resource "aws_autoscaling_policy" "scale_up" {
}
resource "aws_autoscaling_policy" "scale_down" {
lifecycle { create_before_destroy = true }
name = "${var.name}-scale-down"
adjustment_type = "PercentChangeInCapacity"
scaling_adjustment = "${var.scale_down_scaling_adjustment}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment