Merge pull request #61 from bshelton229/worker-subnets

Optionally define worker subnets
This commit is contained in:
Brandon J. O'Connor
2018-07-11 23:05:39 -07:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ variable "workers_group_defaults" {
ebs_optimized = true # sets whether to use ebs optimization on supported types.
public_ip = false # Associate a public ip address with a worker
kubelet_node_labels = "" # This string is passed directly to kubelet via --node-lables= if set. It should be comma delimited with no spaces. If left empty no --node-labels switch is added.
subnets = "" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789
}
}

View File

@@ -4,7 +4,7 @@ resource "aws_autoscaling_group" "workers" {
max_size = "${lookup(var.worker_groups[count.index], "asg_max_size",lookup(var.workers_group_defaults, "asg_max_size"))}"
min_size = "${lookup(var.worker_groups[count.index], "asg_min_size",lookup(var.workers_group_defaults, "asg_min_size"))}"
launch_configuration = "${element(aws_launch_configuration.workers.*.id, count.index)}"
vpc_zone_identifier = ["${var.subnets}"]
vpc_zone_identifier = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "subnets", ""), join(",", var.subnets)))}"]
count = "${length(var.worker_groups)}"
tags = ["${concat(