Skip to content

Commit

Permalink
Adding an option to apply tags to the launch configuration security g…
Browse files Browse the repository at this point in the history
…roup
  • Loading branch information
jcejohnson committed Aug 16, 2018
1 parent c92c6cb commit c74baad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/consul-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "aws_autoscaling_group" "autoscaling_group" {
value = "${var.cluster_tag_value}"
propagate_at_launch = true
},
"${var.tags}",
"${var.tags}"
]
}

Expand Down Expand Up @@ -96,9 +96,7 @@ resource "aws_security_group" "lc_security_group" {
create_before_destroy = true
}

tags {
Name = "${var.cluster_name}"
}
tags = "${merge(map("Name", var.cluster_name), var.security_group_tags)}"
}

resource "aws_security_group_rule" "allow_ssh_inbound" {
Expand Down
6 changes: 6 additions & 0 deletions modules/consul-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ variable "allowed_inbound_security_group_ids" {
default = []
}

variable "security_group_tags" {
description = "Tags to be applied to the LC security group"
type = "map"
default = {}
}

variable "termination_policies" {
description = "A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, Default."
default = "Default"
Expand Down

0 comments on commit c74baad

Please sign in to comment.