diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b42484..259c420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Added - security group id can be provided for either/both of the cluster and the workers. If not provided, security groups will be created with sufficient rules to allow cluster-worker communication. - kudos to @tanmng on the idea ⭐ +- outputs of security group ids and worker ASG arns added for working with these resources outside the module. ### Changed diff --git a/README.md b/README.md index 783f09b..83e4035 100644 --- a/README.md +++ b/README.md @@ -116,3 +116,4 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | config_map_aws_auth | A kubernetes configuration to authenticate to this EKS cluster. | | kubeconfig | kubectl config file contents for this EKS cluster. | | worker_security_group_id | Security group ID attached to the EKS workers. | +| workers_asg_arns | IDs of the autoscaling groups containing workers. | diff --git a/outputs.tf b/outputs.tf index c6753e1..37145f4 100644 --- a/outputs.tf +++ b/outputs.tf @@ -39,6 +39,11 @@ output "kubeconfig" { value = "${data.template_file.kubeconfig.rendered}" } +output "workers_asg_arns" { + description = "IDs of the autoscaling groups containing workers." + value = "${aws_autoscaling_group.workers.*.arn}" +} + output "worker_security_group_id" { description = "Security group ID attached to the EKS workers." value = "${local.worker_security_group_id}" diff --git a/workers.tf b/workers.tf index ae82fe8..1056712 100644 --- a/workers.tf +++ b/workers.tf @@ -17,7 +17,7 @@ resource "aws_autoscaling_group" "workers" { } resource "aws_launch_configuration" "workers" { - name_prefix = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}-" + name = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}" associate_public_ip_address = true security_groups = ["${local.worker_security_group_id}"] iam_instance_profile = "${aws_iam_instance_profile.workers.id}"