Here’s how to get a list of EC2 instances with a status of impaired.

aws ec2 describe-instance-status \
--filters Name=instance-status.status,Values=impaired