stephenchu/awsm-cli

describe-auto-scaling-instances.sh does not appear to work cross-region

Closed this issue · 1 comments

Example:

awsm ec2 describe-regions -r "us-west-2 us-east-1" | awsm ec2 describe-vpcs | grep stag | awsm autoscaling describe-auto-scaling-groups | awsm autoscaling describe-auto-scaling-instances | column -t -s $'\t'

... only shows us-east-1 instances info but not us-west-2.

Reason:

An error occurred (ValidationError) when calling the DescribeAutoScalingInstances operation: The number of instance ids that may be passed in is limited to 50

Workaround:

Use parallel to hopefully reduce the number of i-* identifiers into each native describe-auto-scaling-instances call:

awsm ec2 describe-regions -r "us-west-2 us-east-1" \
    | awsm ec2 describe-vpcs \
    | grep stag \
    | awsm autoscaling describe-auto-scaling-groups \
    | parallel --pipe -k -N 10 awsm autoscaling describe-auto-scaling-instances \
    | column -t -s $'\t'