Commit 23f4fdea authored by Adrian Horrocks's avatar Adrian Horrocks

changes for terraform 12.13

parent 82a3ccf5
variable "availability_zones" {
description = "List of availability zone in which the ECS cluster should reside"
type = "list"
type = list
}
variable "vpc_id" {
......@@ -9,7 +9,7 @@ variable "vpc_id" {
variable "subnet_ids" {
description = "List of subnets in which the ECS cluster should reside"
type = "list"
type = list
}
variable "image_id" {
......@@ -34,7 +34,7 @@ variable "bastion_instances" {
resource "aws_security_group" "bastion" {
name = "Bastion"
vpc_id = "${var.vpc_id}"
vpc_id = var.vpc_id
description = "Allows traffic from and to the Bastion EC2 instance"
ingress {
......@@ -72,38 +72,38 @@ data "template_file" "userdata" {
}
resource "aws_launch_configuration" "bastion" {
name_prefix = "${format("%s-", "Bastion")}"
name_prefix = format("%s-", "Bastion")
image_id = "${var.image_id}"
instance_type = "${var.instance_type}"
key_name = "${var.key_name}"
security_groups = ["${aws_security_group.bastion.id}"]
user_data = "${data.template_file.userdata.rendered}"
image_id = var.image_id
instance_type = var.instance_type
key_name = var.key_name
security_groups = [aws_security_group.bastion.id]
user_data = data.template_file.userdata.rendered
lifecycle {
create_before_destroy = true
ignore_changes = [
"image_id",
image_id,
]
}
}
resource "aws_autoscaling_group" "bastion" {
name = "Bastion - ${aws_launch_configuration.bastion.name}"
availability_zones = "${var.availability_zones}"
vpc_zone_identifier = flatten(["${var.subnet_ids}"])
launch_configuration = "${aws_launch_configuration.bastion.id}"
min_size = "${var.bastion_instances}"
max_size = "${var.bastion_instances}"
desired_capacity = "${var.bastion_instances}"
tags {
availability_zones = var.availability_zones
vpc_zone_identifier = flatten([var.subnet_ids])
launch_configuration = aws_launch_configuration.bastion.id
min_size = var.bastion_instances
max_size = var.bastion_instances
desired_capacity = var.bastion_instances
tag {
key = "Name"
value = "Bastion"
propagate_at_launch = true
}
tags {
tag {
key = "service"
value = "bastion"
propagate_at_launch = 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