Skip to content

Instantly share code, notes, and snippets.

@gsantovena
Last active May 16, 2018 22:07
Show Gist options
  • Save gsantovena/7f18457c9ba8db5ff8d9 to your computer and use it in GitHub Desktop.
Save gsantovena/7f18457c9ba8db5ff8d9 to your computer and use it in GitHub Desktop.

Revisions

  1. gsantovena revised this gist Jun 11, 2015. No changes.
  2. gsantovena created this gist Jun 11, 2015.
    7 changes: 7 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    aws --output text --region ${REGION} ec2 describe-instances --instance-ids $(
    aws --output text --region ${REGION} \
    autoscaling describe-auto-scaling-instances \
    --query 'AutoScalingInstances[*].[AutoScalingGroupName,InstanceId]' |
    grep ${ASG} |
    awk '{ print $2 }'
    ) --query 'Reservations[*].Instances[*].[InstanceId,PrivateIpAddress]'