Using JMESPath and aws ec2 describe instances to output multiple tag values
问题 I'm trying to output multiple tags from an ec2 instances description. The tag values that I want are Name and aws:autoscaling:groupName. "Tags": [ { "Value": "somename", "Key": "Name" }, { "Value": "some-asg-name", "Key": "aws:autoscaling:groupName" }, { "Value": "somethingelse", "Key": "project" } ], Here's what I have so far: aws ec2 describe-instances --instance-ids i-12345678 --query 'Reservations[].Instances[].[Tags[? contains(`["aws:autoscaling:groupName","Name"]`, Key)] | [0].Value,[1]