From 5531776e2c67f9b481888768a766e90ef72d2867 Mon Sep 17 00:00:00 2001 From: Touch Ungboriboonpisal Date: Tue, 4 Sep 2018 03:31:16 -0700 Subject: [PATCH] Allow a custom AMI to be specified as a default (#115) * fallback to the default workers group ami_id before the official one * add CHANGELOG --- CHANGELOG.md | 1 + workers.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9502b..9a3fc45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Changed - A subtle but thoughtful change. (Boomshakalaka, @self 🏀) +- allow a custom AMI to be specified as a default (by @erks) - **Breaking change** Removed support for `eks-worker-*` AMI. The cluster specifying a custom AMI based off of `eks-worker-*` AMI will have to rebuild the AMI from `amazon-eks-node-*`. (by @erks) - **Breaking change** Removed `kubelet_node_labels` worker group option in favor of `kubelet_extra_args`. (by @erks) diff --git a/workers.tf b/workers.tf index 05b6d36..8156738 100644 --- a/workers.tf +++ b/workers.tf @@ -26,7 +26,7 @@ resource "aws_launch_configuration" "workers" { associate_public_ip_address = "${lookup(var.worker_groups[count.index], "public_ip", lookup(local.workers_group_defaults, "public_ip"))}" security_groups = ["${local.worker_security_group_id}"] iam_instance_profile = "${aws_iam_instance_profile.workers.id}" - image_id = "${lookup(var.worker_groups[count.index], "ami_id", data.aws_ami.eks_worker.id)}" + image_id = "${lookup(var.worker_groups[count.index], "ami_id", lookup(local.workers_group_defaults, "ami_id", data.aws_ami.eks_worker.id))}" instance_type = "${lookup(var.worker_groups[count.index], "instance_type", lookup(local.workers_group_defaults, "instance_type"))}" key_name = "${lookup(var.worker_groups[count.index], "key_name", lookup(local.workers_group_defaults, "key_name"))}" user_data_base64 = "${base64encode(element(data.template_file.userdata.*.rendered, count.index))}"