scottslowe-learning-tools/terraform/aws/ic-module-asg/modules/ic-asg/main.tf
Scott Lowe 5645144589
Update formatting
Update formatting of all Terraform configuration files per `terraform fmt`

Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
2017-10-18 11:52:09 -06:00

27 lines
891 B
HCL

# Create a launch configuration for the instance cluster
resource "aws_launch_configuration" "lc" {
name = "${var.name}-lc"
associate_public_ip_address = "${var.assign_pub_ip}"
image_id = "${var.ami}"
instance_type = "${var.type}"
key_name = "${var.ssh_key}"
security_groups = ["${var.sec_group_list}"]
lifecycle {
create_before_destroy = true
}
}
# Create an Auto Scaling group for the instance cluster
resource "aws_autoscaling_group" "asg" {
name = "${var.name}-asg"
min_size = "${var.min_size}"
max_size = "${var.max_size}"
desired_capacity = "${var.min_size}"
vpc_zone_identifier = ["${var.subnet_list}"]
launch_configuration = "${aws_launch_configuration.lc.name}"
lifecycle {
create_before_destroy = true
}
}