I'm trying to get the OwnerId, StackId, and InstanceId output on the same line. I run the below command with the --output-text option, and it puts the "some_stack" data on a different line.
aws ec2 describe-instances --profile 1234 --filters "Name=image-id,Values=ami-asdf" --query 'Reservations[*].[OwnerId, Instances[0].Tags[?Key==`StackId`].Value[], Instances[0].InstanceId]'
When I run the command without the --output-text option, I can see that "some_stack" is in an array, even though I put [] on .Value to try and flatten it. What am I doing wrong?
Output:
[
[
"1234",
[
"some_stack"
],
"i-ghjk"
]
]