Merge pull request #18 from dreamteam-gg/worker_launch_config_tweaks

Adding configuration for public ip association, name_prefix in worker launch config
This commit is contained in:
Brandon J. O'Connor
2018-06-15 13:24:48 -07:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -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
}
}

View File

@@ -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)}"