Commit db85a146 authored by Chris Merrett's avatar Chris Merrett

Fixed lack of dependancy on LC from ASG

parent 434e4e25
......@@ -148,6 +148,7 @@ 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}"
......@@ -157,16 +158,14 @@ resource "aws_launch_configuration" "main" {
root_block_device {
delete_on_termination = "true"
}
lifecycle {
create_before_destroy = true
}
}
#############################################################################################################
# Autoscaling Groups
#############################################################################################################
resource "aws_autoscaling_group" "main" {
name = "${var.name}"
lifecycle { create_before_destroy = true }
name = "${var.name} - ${aws_launch_configuration.main.name}"
launch_configuration = "${aws_launch_configuration.main.name}"
load_balancers = ["${var.load_balancers}"]
vpc_zone_identifier = ["${var.vpc_zone_identifier}"]
......@@ -187,9 +186,6 @@ resource "aws_autoscaling_group" "main" {
value = "${aws_launch_configuration.main.name}"
propagate_at_launch = true
}
lifecycle {
create_before_destroy = true
}
}
#############################################################################################################
......
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