Commit 49e39431 authored by Jamie Walker's avatar Jamie Walker
parent 4727a83a
...@@ -60,7 +60,7 @@ resource "aws_security_group" "bastion" { ...@@ -60,7 +60,7 @@ resource "aws_security_group" "bastion" {
} }
tags = { tags = {
Name = "Bastion" Name = "Bastion"
} }
lifecycle { create_before_destroy = true } lifecycle { create_before_destroy = true }
...@@ -74,11 +74,11 @@ data "template_file" "userdata" { ...@@ -74,11 +74,11 @@ data "template_file" "userdata" {
resource "aws_launch_configuration" "bastion" { resource "aws_launch_configuration" "bastion" {
name_prefix = "${format("%s-", "Bastion")}" name_prefix = "${format("%s-", "Bastion")}"
image_id = "${var.image_id}" image_id = "${var.image_id}"
instance_type = "${var.instance_type}" instance_type = "${var.instance_type}"
key_name = "${var.key_name}" key_name = "${var.key_name}"
security_groups = ["${aws_security_group.bastion.id}"] security_groups = ["${aws_security_group.bastion.id}"]
user_data = "${data.template_file.userdata.rendered}" user_data = "${data.template_file.userdata.rendered}"
lifecycle { lifecycle {
create_before_destroy = true create_before_destroy = true
...@@ -90,7 +90,6 @@ resource "aws_launch_configuration" "bastion" { ...@@ -90,7 +90,6 @@ resource "aws_launch_configuration" "bastion" {
resource "aws_autoscaling_group" "bastion" { resource "aws_autoscaling_group" "bastion" {
name = "Bastion - ${aws_launch_configuration.bastion.name}" name = "Bastion - ${aws_launch_configuration.bastion.name}"
availability_zones = ["${var.availability_zones}"]
vpc_zone_identifier = ["${var.subnet_ids}"] vpc_zone_identifier = ["${var.subnet_ids}"]
launch_configuration = "${aws_launch_configuration.bastion.id}" launch_configuration = "${aws_launch_configuration.bastion.id}"
min_size = "${var.bastion_instances}" min_size = "${var.bastion_instances}"
...@@ -98,13 +97,13 @@ resource "aws_autoscaling_group" "bastion" { ...@@ -98,13 +97,13 @@ resource "aws_autoscaling_group" "bastion" {
desired_capacity = "${var.bastion_instances}" desired_capacity = "${var.bastion_instances}"
tag { tag {
key = "Name" key = "Name"
value = "Bastion" value = "Bastion"
propagate_at_launch = true propagate_at_launch = true
} }
tag { tag {
key = "service" key = "service"
value = "bastion" value = "bastion"
propagate_at_launch = true propagate_at_launch = true
} }
...@@ -115,5 +114,5 @@ resource "aws_autoscaling_group" "bastion" { ...@@ -115,5 +114,5 @@ resource "aws_autoscaling_group" "bastion" {
# Outputs # Outputs
############################################################################################################# #############################################################################################################
output "security_group" { output "security_group" {
value = "${aws_security_group.bastion.id}" value = "${aws_security_group.bastion.id}"
} }
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