Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Stack join security groups #55

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ variable "ecs_security_groups" {
default = ""
}

variable "ecs_extra_security_groups" {
description = "A comma separated list of security groups added to the default security groups of the stack"
default = ""
}

variable "ecs_ami" {
description = "The AMI that will be used to launch EC2 instances in the ECS cluster"
default = ""
Expand Down Expand Up @@ -213,7 +218,7 @@ module "ecs_cluster" {
docker_volume_size = "${var.ecs_docker_volume_size}"
docker_auth_type = "${var.ecs_docker_auth_type}"
docker_auth_data = "${var.ecs_docker_auth_data}"
security_groups = "${coalesce(var.ecs_security_groups, format("%s,%s,%s", module.security_groups.internal_ssh, module.security_groups.internal_elb, module.security_groups.external_elb))}"
security_groups = "${coalesce(var.ecs_security_groups, join(",", compact(concat(split(",", "${format("%s,%s,%s", module.security_groups.internal_ssh, module.security_groups.internal_elb, module.security_groups.external_elb)}"), split(",", "${var.ecs_extra_security_groups}")))))}"
extra_cloud_config_type = "${var.extra_cloud_config_type}"
extra_cloud_config_content = "${var.extra_cloud_config_content}"
}
Expand Down