Hoping you can help with this query. Hopefully the answer should allow me to construct better queries down the line. I am trying to filter by the root device of a particular instance and get the root devices volume id. Could you explain how I could join two such queries. Searching for DeviceName /dev/sda1 and to then get the corresponding VolumeId.
aws ec2 describe-instances --instance-id i-02bc19e18ef09cdbe --query 'Reservations[].Instances[].BlockDeviceMappings[]'
[
{
"Ebs": {
"AttachTime": "2017-04-20T13:32:04.000Z",
"VolumeId": "vol-0118bd9c0a08164f2",
"DeleteOnTermination": false,
"Status": "attached"
},
"DeviceName": "/dev/sda1"
}
]