Merge pull request #17 from dreamteam-gg/allow_adding_ssh_keys_to_workers

Allow adding SSH keys to worker ASGs
This commit is contained in:
Brandon J. O'Connor
2018-06-15 13:26:12 -07:00
committed by GitHub
2 changed files with 2 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ variable "workers_group_defaults" {
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
instance_type = "m4.large" # Size of the workers instances.
key_name = "" # The key name that should be used for the instances in the autoscaling group
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

@@ -23,6 +23,7 @@ resource "aws_launch_configuration" "workers" {
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)}"
instance_type = "${lookup(var.worker_groups[count.index], "instance_type", lookup(var.workers_group_defaults, "instance_type"))}"
key_name = "${lookup(var.worker_groups[count.index], "key_name", lookup(var.workers_group_defaults, "key_name"))}"
user_data_base64 = "${base64encode(element(data.template_file.userdata.*.rendered, count.index))}"
ebs_optimized = "${lookup(var.worker_groups[count.index], "ebs_optimized", lookup(local.ebs_optimized, lookup(var.worker_groups[count.index], "instance_type", lookup(var.workers_group_defaults, "instance_type")), false))}"
count = "${length(var.worker_groups)}"