Monday, November 28, 2011

ec2-describe-instances filter definitions must have format 'name=value'

I wanted to get a list of my Amazon instances with a particular filter, so I tried something simple as suggested in the ec2-describe-instances documentation: 
ec2-describe-instances --filter "instance-type=m1.small"

However, this returns the following error:
Filter definitions must have format 'name=value', but found 'instance-type'

After a bit of frustration, I finally realized that you have to pass in the quotes in the argument. This means that you need to escape the quotes in Powershell like so:
ec2-describe-instances --filter "`"instance-type=m1.small`""

1 comment: