Skip to content

Commit 60e2259

Browse files
added output for asg
1 parent 210e92d commit 60e2259

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

1212
- 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 ⭐
13+
- outputs of security group ids and worker ASG arns added for working with these resources outside the module.
1314

1415
### Changed
1516

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
116116
| config_map_aws_auth | A kubernetes configuration to authenticate to this EKS cluster. |
117117
| kubeconfig | kubectl config file contents for this EKS cluster. |
118118
| worker_security_group_id | Security group ID attached to the EKS workers. |
119+
| workers_asg_arns | IDs of the autoscaling groups containing workers. |

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ output "kubeconfig" {
3939
value = "${data.template_file.kubeconfig.rendered}"
4040
}
4141

42+
output "workers_asg_arns" {
43+
description = "IDs of the autoscaling groups containing workers."
44+
value = "${aws_autoscaling_group.workers.*.arn}"
45+
}
46+
4247
output "worker_security_group_id" {
4348
description = "Security group ID attached to the EKS workers."
4449
value = "${local.worker_security_group_id}"

workers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ resource "aws_autoscaling_group" "workers" {
1717
}
1818

1919
resource "aws_launch_configuration" "workers" {
20-
name_prefix = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}-"
20+
name = "${var.cluster_name}-${lookup(var.worker_groups[count.index], "name", count.index)}"
2121
associate_public_ip_address = true
2222
security_groups = ["${local.worker_security_group_id}"]
2323
iam_instance_profile = "${aws_iam_instance_profile.workers.id}"

0 commit comments

Comments
 (0)