'How to get autosaclinggroup name with aws cli?

hi guys i need help to solve my problem to get name of autoscalinggroups by using AWS cli with query i try to use this aws eks describe-nodegroup --cluster-name test-server --nodegroup-name default but i just wana get output only autoScalingGroups name . i need help please

example output :

eks-default-20bfe7fd-620b-c44b-c7e3-33f44221240c5


Solution 1:[1]

Auto Scaling Group names can be retrieved using JQ

aws eks describe-nodegroup --cluster-name test-server --nodegroup-name default \
| jq -r '.nodegroup.resources.autoScalingGroups[].name'

The EKS API docs give a clearer picture of the JSON response.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 naaman