Skip to content

Commit 4072725

Browse files
bryantbiggsit-without-politics
authored andcommitted
feat: Add outputs for autoscaling group names created to aid in autoscaling group tagging (terraform-aws-modules#1953)
1 parent 59dd148 commit 4072725

File tree

14 files changed

+78
-0
lines changed

14 files changed

+78
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -934,12 +934,14 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws
934934
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | ID of the cluster security group |
935935
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
936936
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
937+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
937938
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
938939
| <a name="output_node_security_group_arn"></a> [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group |
939940
| <a name="output_node_security_group_id"></a> [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group |
940941
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
941942
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
942943
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
944+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
943945
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
944946

945947
## License

examples/complete/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ No inputs.
9393
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | Cluster security group that was created by Amazon EKS for the cluster. Managed node groups use this security group for control-plane-to-data-plane communication. Referred to as 'Cluster security group' in the EKS console |
9494
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
9595
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
96+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
9697
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
9798
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
9899
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
99100
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
101+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
100102
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ output "eks_managed_node_groups" {
134134
value = module.eks.eks_managed_node_groups
135135
}
136136

137+
output "eks_managed_node_groups_autoscaling_group_names" {
138+
description = "List of the autoscaling group names created by EKS managed node groups"
139+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
140+
}
141+
137142
################################################################################
138143
# Self Managed Node Group
139144
################################################################################
@@ -143,6 +148,11 @@ output "self_managed_node_groups" {
143148
value = module.eks.self_managed_node_groups
144149
}
145150

151+
output "self_managed_node_groups_autoscaling_group_names" {
152+
description = "List of the autoscaling group names created by self-managed node groups"
153+
value = module.eks.self_managed_node_groups_autoscaling_group_names
154+
}
155+
146156
################################################################################
147157
# Additional
148158
################################################################################

examples/eks_managed_node_group/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ No inputs.
125125
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | ID of the cluster security group |
126126
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
127127
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
128+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
128129
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
129130
| <a name="output_node_security_group_arn"></a> [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group |
130131
| <a name="output_node_security_group_id"></a> [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group |
131132
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
132133
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
133134
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
135+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
134136
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/eks_managed_node_group/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ output "eks_managed_node_groups" {
153153
value = module.eks.eks_managed_node_groups
154154
}
155155

156+
output "eks_managed_node_groups_autoscaling_group_names" {
157+
description = "List of the autoscaling group names created by EKS managed node groups"
158+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
159+
}
160+
156161
################################################################################
157162
# Self Managed Node Group
158163
################################################################################
@@ -162,6 +167,11 @@ output "self_managed_node_groups" {
162167
value = module.eks.self_managed_node_groups
163168
}
164169

170+
output "self_managed_node_groups_autoscaling_group_names" {
171+
description = "List of the autoscaling group names created by self-managed node groups"
172+
value = module.eks.self_managed_node_groups_autoscaling_group_names
173+
}
174+
165175
################################################################################
166176
# Additional
167177
################################################################################

examples/fargate_profile/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ No inputs.
6868
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | ID of the cluster security group |
6969
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
7070
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
71+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
7172
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
7273
| <a name="output_node_security_group_arn"></a> [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group |
7374
| <a name="output_node_security_group_id"></a> [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group |
7475
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
7576
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
7677
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
78+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
7779
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/fargate_profile/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ output "eks_managed_node_groups" {
153153
value = module.eks.eks_managed_node_groups
154154
}
155155

156+
output "eks_managed_node_groups_autoscaling_group_names" {
157+
description = "List of the autoscaling group names created by EKS managed node groups"
158+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
159+
}
160+
156161
################################################################################
157162
# Self Managed Node Group
158163
################################################################################
@@ -162,6 +167,11 @@ output "self_managed_node_groups" {
162167
value = module.eks.self_managed_node_groups
163168
}
164169

170+
output "self_managed_node_groups_autoscaling_group_names" {
171+
description = "List of the autoscaling group names created by self-managed node groups"
172+
value = module.eks.self_managed_node_groups_autoscaling_group_names
173+
}
174+
165175
################################################################################
166176
# Additional
167177
################################################################################

examples/irsa_autoscale_refresh/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ No inputs.
9090
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | ID of the cluster security group |
9191
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
9292
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
93+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
9394
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
9495
| <a name="output_node_security_group_arn"></a> [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group |
9596
| <a name="output_node_security_group_id"></a> [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group |
9697
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
9798
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
9899
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
100+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
99101
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/irsa_autoscale_refresh/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ output "eks_managed_node_groups" {
153153
value = module.eks.eks_managed_node_groups
154154
}
155155

156+
output "eks_managed_node_groups_autoscaling_group_names" {
157+
description = "List of the autoscaling group names created by EKS managed node groups"
158+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
159+
}
160+
156161
################################################################################
157162
# Self Managed Node Group
158163
################################################################################
@@ -162,6 +167,11 @@ output "self_managed_node_groups" {
162167
value = module.eks.self_managed_node_groups
163168
}
164169

170+
output "self_managed_node_groups_autoscaling_group_names" {
171+
description = "List of the autoscaling group names created by self-managed node groups"
172+
value = module.eks.self_managed_node_groups_autoscaling_group_names
173+
}
174+
165175
################################################################################
166176
# Additional
167177
################################################################################

examples/self_managed_node_group/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ No inputs.
8888
| <a name="output_cluster_security_group_id"></a> [cluster\_security\_group\_id](#output\_cluster\_security\_group\_id) | ID of the cluster security group |
8989
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` |
9090
| <a name="output_eks_managed_node_groups"></a> [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created |
91+
| <a name="output_eks_managed_node_groups_autoscaling_group_names"></a> [eks\_managed\_node\_groups\_autoscaling\_group\_names](#output\_eks\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by EKS managed node groups |
9192
| <a name="output_fargate_profiles"></a> [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created |
9293
| <a name="output_node_security_group_arn"></a> [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group |
9394
| <a name="output_node_security_group_id"></a> [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group |
9495
| <a name="output_oidc_provider"></a> [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) |
9596
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` |
9697
| <a name="output_self_managed_node_groups"></a> [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created |
98+
| <a name="output_self_managed_node_groups_autoscaling_group_names"></a> [self\_managed\_node\_groups\_autoscaling\_group\_names](#output\_self\_managed\_node\_groups\_autoscaling\_group\_names) | List of the autoscaling group names created by self-managed node groups |
9799
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/self_managed_node_group/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ output "eks_managed_node_groups" {
153153
value = module.eks.eks_managed_node_groups
154154
}
155155

156+
output "eks_managed_node_groups_autoscaling_group_names" {
157+
description = "List of the autoscaling group names created by EKS managed node groups"
158+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
159+
}
160+
156161
################################################################################
157162
# Self Managed Node Group
158163
################################################################################
@@ -162,6 +167,11 @@ output "self_managed_node_groups" {
162167
value = module.eks.self_managed_node_groups
163168
}
164169

170+
output "self_managed_node_groups_autoscaling_group_names" {
171+
description = "List of the autoscaling group names created by self-managed node groups"
172+
value = module.eks.self_managed_node_groups_autoscaling_group_names
173+
}
174+
165175
################################################################################
166176
# Additional
167177
################################################################################

modules/eks-managed-node-group/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ module "eks_managed_node_group" {
171171
| <a name="output_launch_template_id"></a> [launch\_template\_id](#output\_launch\_template\_id) | The ID of the launch template |
172172
| <a name="output_launch_template_latest_version"></a> [launch\_template\_latest\_version](#output\_launch\_template\_latest\_version) | The latest version of the launch template |
173173
| <a name="output_node_group_arn"></a> [node\_group\_arn](#output\_node\_group\_arn) | Amazon Resource Name (ARN) of the EKS Node Group |
174+
| <a name="output_node_group_autoscaling_group_names"></a> [node\_group\_autoscaling\_group\_names](#output\_node\_group\_autoscaling\_group\_names) | List of the autoscaling group names |
174175
| <a name="output_node_group_id"></a> [node\_group\_id](#output\_node\_group\_id) | EKS Cluster name and EKS Node Group name separated by a colon (`:`) |
175176
| <a name="output_node_group_resources"></a> [node\_group\_resources](#output\_node\_group\_resources) | List of objects containing information about underlying resources |
176177
| <a name="output_node_group_status"></a> [node\_group\_status](#output\_node\_group\_status) | Status of the EKS Node Group |

modules/eks-managed-node-group/outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ output "node_group_resources" {
3636
value = try(aws_eks_node_group.this[0].resources, "")
3737
}
3838

39+
output "node_group_autoscaling_group_names" {
40+
description = "List of the autoscaling group names"
41+
value = try(flatten(aws_eks_node_group.this[0].resources[*].autoscaling_groups[*].name), [])
42+
}
43+
3944
output "node_group_status" {
4045
description = "Status of the EKS Node Group"
4146
value = try(aws_eks_node_group.this[0].arn, "")

0 commit comments

Comments
 (0)