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.describe_volumes does not document surprising behavior of VolumeIds param when passed as [] #4027

Closed
kac460 opened this issue Feb 23, 2024 · 4 comments
Assignees
Labels
bug This issue is a confirmed bug. documentation This is a problem with documentation. p3 This is a minor priority issue

Comments

@kac460
Copy link

kac460 commented Feb 23, 2024

Describe the issue

The VolumeIds param of describe_volumes has some surprising behavior: if you pass an empty list [] then all volume ids are matched. It's easy to see how this surprising behavior is potentially problematic if someone does not realize this is the behavior. But this behavior is not documented in the boto3 docs; the description is only:

The volume IDs.

The docs should explain this behavior.

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/describe_volumes.html

@kac460 kac460 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2024
@kac460 kac460 changed the title EC2.Client.describe_volumes does not document behavior of VolumeIds param EC2.Client.describe_volumes does not document surprising behavior of VolumeIds param when passed as [] Feb 23, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this May 3, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK added bug This issue is a confirmed bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels May 3, 2024
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @kac460, thanks for reaching out. I was able to reproduce this behavior, but I'm not sure I agree with it being surprising. The SDK interprets the empty list as if the parameter wasn't included at all. What were you anticipating the behavior to be?

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional information or feedback. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels May 3, 2024
@kac460
Copy link
Author

kac460 commented May 10, 2024

Hi @kac460, thanks for reaching out. I was able to reproduce this behavior, but I'm not sure I agree with it being surprising. The SDK interprets the empty list as if the parameter wasn't included at all. What were you anticipating the behavior to be?

Thanks for the reply. I'd expect either nothing to match or for an error to be raised. It's dangerous if you have, for example, a script that

  1. Finds/generates a list of volume ids based on some criteria
  2. Passes that list to describe_volumes
  3. Does some action for every volume returned by describe_volumes

This script would be unsafe if the criteria for (1) match no volume ids resulting in an empty list. Then the output for (3) will include every single volume in the account, so the action which shouldn't be taken on any volume (since none matched the criteria in (1)) would in actuality be taken on all volumes.

@github-actions github-actions bot removed the response-requested Waiting on additional information or feedback. label May 11, 2024
@RyanFitzSimmonsAK
Copy link
Contributor

RyanFitzSimmonsAK commented May 22, 2024

Gotcha. I've reached out to the EC2 team about this documentation clarification. As this is a service team issue, I've created a tracking issue in our cross-SDK repository (aws/aws-sdk#755). Please refer to that issue for updates going forward. Thanks!

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. documentation This is a problem with documentation. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants