aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`].Value[] | [0],InstanceId:InstanceId,Inst
anceType:InstanceType}' --filter "Name=instance-state-name,Values=running" --no-verify
-------------------------------------------------------------------
| DescribeInstances |
+----------------------+---------------+--------------------------+
| InstanceId | InstanceType | Name |
+----------------------+---------------+--------------------------+
| i-051cfe892501c68e5 | t2.nano | ixVPC-Ubuntu1-instance |
| i-089af23ab4698867b | c3.xlarge | ixVPC-vSRX1 |
+----------------------+---------------+--------------------------+
Without the : " | [0]"
------------------------
aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`].Value[],InstanceId:InstanceId,InstanceTy
pe:InstanceType}' --filter "Name=instance-state-name,Values=running" --no-verify
-----------------------------------------
| DescribeInstances |
+----------------------+----------------+
| InstanceId | InstanceType |
+----------------------+----------------+
| i-051cfe892501c68e5 | t2.nano |
+----------------------+----------------+
|| Name ||
|+-------------------------------------+|
|| ixVPC-Ubuntu1-instance ||
|+-------------------------------------+|
| DescribeInstances |
+----------------------+----------------+
| InstanceId | InstanceType |
+----------------------+----------------+
| i-089af23ab4698867b | c3.xlarge |
+----------------------+----------------+
|| Name ||
|+-------------------------------------+|
|| ixVPC-vSRX1 ||
|+-------------------------------------+|
|