根据标记过滤实例

I'm getting Validation error messages with

$workers = array('Filters' => array(array('Name' => 'Tags', array(array('Key' => 'Name', 'Values' => array('mworker'))))));

$list = $ec2Client->describeInstances($workers);

Error Detail:

[Filters][0][Filter] must be an array of properties. Got a numerically indexed array.'

This is with SDK2

Found the correct syntax:

$workers = array(array('Filters' => array('Name' => 'Tags', array('Key' => 'Name', 'Values' => array('mworker')))));

That actually didn't work for me - it seems the correct way to search by tags is:

$response = $ec2->describeInstances(array(
    'Filters' => array(
        array('Name' => 'instance-type', 'Values' => array('m1.small')),
        array('Name' => 'tag-value', 'Key' => 'Name', 'Values' => array('Testing'))
    )
));

Which also has a filter on instance-type to show how they are combined.