-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Comments
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
This script would be unsafe if the criteria for (1) match no volume ids resulting in an empty |
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! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the issue
The
VolumeIds
param ofdescribe_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 docs should explain this behavior.
Links
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/describe_volumes.html
The text was updated successfully, but these errors were encountered: