From 50404a785bf057c2b14c9811c1e40367a4ac7498 Mon Sep 17 00:00:00 2001 From: Touch Ungboriboonpisal Date: Tue, 11 Sep 2018 09:03:23 -0700 Subject: [PATCH] fix default worker subnets not working (#122) --- CHANGELOG.md | 1 + local.tf | 2 +- workers.tf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3883983..6a9c348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Changed - A subtle but thoughtful change. (Boomshakalaka, @self 🏀) +- fix default worker subnets not working (by @erks) ## [[v1.6.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v1.5.0...v1.6.0)] - 2018-09-04] diff --git a/local.tf b/local.tf index 0e28d84..8d737f5 100644 --- a/local.tf +++ b/local.tf @@ -26,7 +26,7 @@ locals { enable_monitoring = true # Enables/disables detailed monitoring. public_ip = false # Associate a public ip address with a worker kubelet_extra_args = "" # This string is passed directly to kubelet if set. Useful for adding labels or taints. - subnets = "" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789 + subnets = "${join(",", var.subnets)}" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789 autoscaling_enabled = false # Sets whether policy and matching tags will be added to allow autoscaling. additional_security_group_ids = "" # A comman delimited list of additional security group ids to include in worker launch config } diff --git a/workers.tf b/workers.tf index 649caa5..e3bbf1d 100644 --- a/workers.tf +++ b/workers.tf @@ -4,7 +4,7 @@ resource "aws_autoscaling_group" "workers" { max_size = "${lookup(var.worker_groups[count.index], "asg_max_size",lookup(local.workers_group_defaults, "asg_max_size"))}" min_size = "${lookup(var.worker_groups[count.index], "asg_min_size",lookup(local.workers_group_defaults, "asg_min_size"))}" launch_configuration = "${element(aws_launch_configuration.workers.*.id, count.index)}" - vpc_zone_identifier = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "subnets", ""), join(",", var.subnets)))}"] + vpc_zone_identifier = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "subnets", ""), lookup(local.workers_group_defaults, "subnets")))}"] count = "${var.worker_group_count}" tags = ["${concat(