Skip to content

Commit

Permalink
Adds default_security_groups boolean variable
Browse files Browse the repository at this point in the history
  • Loading branch information
charly-vega committed Jul 2, 2018
1 parent 86a1cd0 commit 34a5c09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "aws_instance" "data_node" {
key_name = "${var.key_name}"
user_data = "${var.user_data == "" ? file("${path.module}/files/init.sh") : var.user_data }"
ebs_optimized = true
vpc_security_group_ids = ["${concat(list(aws_security_group.influx_cluster.id, aws_security_group.data_node.id), var.security_groups)}"]
vpc_security_group_ids = ["${var.default_security_groups == true ? concat(list(aws_security_group.influx_cluster.id, aws_security_group.data_node.id), var.security_groups) : var.security_groups}"]
count = "${var.data_instances}"
}

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ variable "security_groups" {
default = []
}

variable "default_security_groups" {
description = "Whether default security groups should be applied"
default = true
}

variable "user_data" {
description = "User data script for all instances"
default = ""
Expand Down

0 comments on commit 34a5c09

Please sign in to comment.