Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2 Client does not honor parameters #39

Closed
theRealDrumBum opened this issue Feb 4, 2013 · 4 comments
Closed

ec2 Client does not honor parameters #39

theRealDrumBum opened this issue Feb 4, 2013 · 4 comments
Labels
guidance Question that needs advice or information.

Comments

@theRealDrumBum
Copy link

I Briefly ran through the code, but it looks like params are not being passed on the ec2 client (the only PostField for curl on the stack was the 'describeInstances' method name). For example:

$response = $ec2->describeInstances(array(
'Filter' => array(
// So AWS isn't exactly honoring this filter, will need to double check below
array(
'Name' => 'instance-state-name',
'Value' => $filterStopped ? 'running' : '*'
),
array(
'Name' => 'tag-key',
'Value' => $tag
)
)
));

Returns the entire corpus of our ec2 account and does not do any filtering.

@mtdowling
Copy link
Member

The value you should pass is actually Filters not Filter. Does that fix the issue for you?

@theRealDrumBum
Copy link
Author

Good catch! It changed the results, but it wasn't why I expected. I changed it to handle a very simple case first:

  'Filters' => array(
                array(
                    'Name'   => 'instance-state-name',
                    'Value'  => 'running'
                )

And didn't get any results..., where without the Filter I get 197 results (mixed with running and stopped states).

@jeremeamia
Copy link
Contributor

See the API docs for DescribeInstances.

Values should also plural (i.e.,Value should be Values). Sorry we didn't catch that the first time around. It should look like:

'Filters' => array(
    array(
        'Name'   => 'instance-state-name',
        'Values' => array('running')
    )
)

There is also an example in the EC2 integration tests.

@theRealDrumBum
Copy link
Author

Awesome! Thanks for pointing that out.

@diehlaws diehlaws added guidance Question that needs advice or information. and removed no-issue labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

4 participants