From 60dfeca191cc60f14e107bd1c8a002360b7cf621 Mon Sep 17 00:00:00 2001 From: Max Williams Date: Tue, 7 May 2019 11:09:44 +0200 Subject: [PATCH] Adding 2 new outputs: AMI ID and work user-data (#364) * Adding 2 new outputs: AMI ID and work user-data * adding separate outputs to include both --- CHANGELOG.md | 2 +- README.md | 2 ++ outputs.tf | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fafa4c1..ffbfb94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,9 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Added +- Added outputs for `workers_user_data` and `workers_default_ami_id` (by @max-rocket-internet) - Added doc about spot instances (by @max-rocket-internet) - Added support for custom service linked role for Auto Scaling group (by @voanhduy1512) -- Write your awesome addition here (by @you) ### Changed diff --git a/README.md b/README.md index 13df9ee..4a01f89 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,8 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | worker\_security\_group\_id | Security group ID attached to the EKS workers. | | workers\_asg\_arns | IDs of the autoscaling groups containing workers. | | workers\_asg\_names | Names of the autoscaling groups containing workers. | +| workers\_default\_ami\_id | ID of the default worker group AMI | +| workers\_user\_data | User data of worker groups | | workers\_launch\_template\_arns | ARNs of the worker launch templates. | | workers\_launch\_template\_ids | IDs of the worker launch templates. | | workers\_launch\_template\_latest\_versions | Latest versions of the worker launch templates. | diff --git a/outputs.tf b/outputs.tf index 83a0c11..55d20fb 100644 --- a/outputs.tf +++ b/outputs.tf @@ -64,6 +64,16 @@ output "workers_asg_names" { value = "${concat(aws_autoscaling_group.workers.*.id, aws_autoscaling_group.workers_launch_template.*.id)}" } +output "workers_user_data" { + description = "User data of worker groups" + value = "${concat(data.template_file.userdata.*.rendered, data.template_file.launch_template_userdata.*.rendered)}" +} + +output "workers_default_ami_id" { + description = "ID of the default worker group AMI" + value = "${data.aws_ami.eks_worker.id}" +} + output "workers_launch_template_ids" { description = "IDs of the worker launch templates." value = "${aws_launch_template.workers_launch_template.*.id}"