3 ms·
Hasn’t AWSCLI supported toggling the cmd output to either text, json or csv for quite some time now or have I misunderstood your comment here?
by dvtrn 7y ago
Hasn’t AWSCLI supported toggling the cmd output to either text, json or csv for quite some time now or have I misunderstood your comment here?
- jolux 7y agoYou don’t get the impedance mismatch of text to objects that bash has when dealing with the complexity of AWS resources.
- failmode 7y agoBash-My-AWS wraps AWSCLI as thinly as possible and makes use of JMESPath and the text output. The result is you have a simple set of commands that don't require you to type hundreds of characters. instances() { local instance_ids=$(__bma_read_inputs) local filters=$(__bma_read_filters $@) aws ec2 describe-instances \ $([[ -n ${instance_ids} ]] && echo --instance-ids ${instance_ids}) \ --query " Reservations[].Instances[][ InstanceId, InstanceType, State.Name, [Tags[?Key=='Name'].Value][0][0], LaunchTime, Placement.AvailabilityZone, VpcId ]" \ --output text | grep -E -- "$filters" | LC_ALL=C sort -b -k 6 | column -s$'\t' -t }