Getting a list of instances in an EC2 auto scale group?

前端 未结 7 997
一整个雨季
一整个雨季 2020-12-19 04:13

Is there a utility or script available to retrieve a list of all instances from AWS EC2 auto scale group?

I need a dynamically generated list of production instance

7条回答
  •  甜味超标
    2020-12-19 04:50

    You can use the describe-auto-scaling-instances cli command, and query for your autoscale group name.

    Example:

    aws autoscaling describe-auto-scaling-instances --region us-east-1 --query 'AutoScalingInstances[?AutoScalingGroupName==`YOUR_ASG`]' --output text

    Hope that helps

提交回复
热议问题