Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws cli --query doesn't filter output in windows command promt

I am following the documentation to use the --query option in aws cli. However it doesn't work for me at all. I have defined profiles because I have several accounts to pull the data. If I omit the --query, it returns the data successfully. Any insight into this please?

Thank you

> aws --version
aws-cli/1.14.8 Python/3.6.3 Windows/10 botocore/1.8.12

> aws ec2 describe-volumes --profile TEST1 --region us-east-1 --query 'Volumes[0]'
"Volumes[0]"

> aws ec2 describe-volumes --profile TEST1 --region us-east-1
{
    "Volumes": [
        {
            "Attachments": [ ....
like image 617
Ben Avatar asked Feb 11 '26 12:02

Ben


1 Answers

Change from single quotes to double quotes:

aws ec2 describe-volumes --profile TEST1 --region us-east-1 --query "Volumes[0]"
like image 128
John Hanley Avatar answered Feb 15 '26 19:02

John Hanley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!