This script is designed to run line by line of a text file containing EC2 Instance ID’s. how long does it take ivermectin to start working I then Queried the results to only show the ID, Name and State (other properties can be added with ease). I also decided output to text was best for the results to be in human readable format.
#/bin/sh # Ben Prudence - Get Inbstances from Text File of Instance IDs echo -n "Profile Name: " read profile cat InstanceList.txt | while read instance do aws ec2 describe-instances --instance-ids $instance --profile $profile --query 'Reservations.Instances.[InstanceId, Tags[?Key==`Name`] | .Value, State.Name]' --output text done