From 6fad724abde18e232a1b6d3fa34627e1873c05e2 Mon Sep 17 00:00:00 2001 From: Igor Borodin Date: Fri, 15 Jun 2018 16:28:30 +0300 Subject: [PATCH] Adding configuration for public ip association, moving to name_prefix in worker launch config --- variables.tf | 1 + workers.tf | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index 8020b3c..0598815 100644 --- a/variables.tf +++ b/variables.tf @@ -58,6 +58,7 @@ variable "workers_group_defaults" { instance_type = "m4.large" # Size of the workers instances. additional_userdata = "" # userdata to append to the default userdata. ebs_optimized = true # sets whether to use ebs optimization on supported types. + public_ip = false # Associate a public ip address with a worker } } diff --git a/workers.tf b/workers.tf index 1056712..abf8684 100644 --- a/workers.tf +++ b/workers.tf @@ -17,8 +17,8 @@ resource "aws_autoscaling_group" "workers" { } resource "aws_launch_configuration" "workers" { - name = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}" - associate_public_ip_address = true + name_prefix = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}" + associate_public_ip_address = "${lookup(var.worker_groups[count.index], "public_ip", lookup(var.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)}"