title: How can I combine AWS EC2 describe-instances with describe-image?
body: <p>I have 2 API calls, the second uses AMI-ID from the first</p>
  <pre><code>aws ec2 describe-instances \
      --query &quot;Reservations[*].{ \
          OWNERID:OwnerId, \
          IP:Instances[0].PublicIpAddress, \
          ImageID:Instances[0].ImageId, \
          AZ:Instances[0].Placement.AvailabilityZone, \
          STATE:Instances[0].State.Name, \
          KEY:Instances[0].KeyName, \
          VPC:Instances[0].VpcId, \
          ID:Instances[0].InstanceId, \
          INSTANCETYPE:Instances[0].InstanceType \
          }&quot; --output text
  </code></pre>
  <p>and</p>
  <pre><code>aws ec2 describe-images \
      --image-ids ami-xxx\
      --query &quot;Images[*].{ImageName:Name, AWSDescription:Description}&quot; \
      --output text
  </code></pre>
  <p>I am trying to have individual instances with the image name and description from their respective images on the same lines, for a single table with all the columns from both calls.</p>
  <p>Is it possible to do it in the same command (i strongly doubt it)?
  If not, how would I go about in a shell script?
  Do I have to grep the AMI-ID from the first call and use it? But that first call returns a whole table, how can i then &quot;append&quot; the extra columns next to the first ones and not under?</p>