Skip to content

Commit 75f6f1e

Browse files
Merge pull request #61 from bshelton229/worker-subnets
Optionally define worker subnets
2 parents 0a36674 + 399f1f2 commit 75f6f1e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ variable "workers_group_defaults" {
9191
ebs_optimized = true # sets whether to use ebs optimization on supported types.
9292
public_ip = false # Associate a public ip address with a worker
9393
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.
94+
subnets = "" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789
9495
}
9596
}
9697

workers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resource "aws_autoscaling_group" "workers" {
44
max_size = "${lookup(var.worker_groups[count.index], "asg_max_size",lookup(var.workers_group_defaults, "asg_max_size"))}"
55
min_size = "${lookup(var.worker_groups[count.index], "asg_min_size",lookup(var.workers_group_defaults, "asg_min_size"))}"
66
launch_configuration = "${element(aws_launch_configuration.workers.*.id, count.index)}"
7-
vpc_zone_identifier = ["${var.subnets}"]
7+
vpc_zone_identifier = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "subnets", ""), join(",", var.subnets)))}"]
88
count = "${length(var.worker_groups)}"
99

1010
tags = ["${concat(

0 commit comments

Comments
 (0)