-
Notifications
You must be signed in to change notification settings - Fork 656
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.NewDescribeInstanceTypesPaginator response differs from AWS CLI response for the same filter #2912
Comments
The problem is that the filter on this operation is not "filter before you make the request" but rather "once you get the response, apply this filter". Hence, when you do this
You short-circuit if the response is not found on the first page. Worse, since the response is not guaranteed to maintain the same order, it may succeed one time and fail the next. This behavior is sort-of implied on the docs, but I agree it could be made more explicit
If you get rid of that As from the other command
You do actually get the full HTTP request with
Although since this shows the raw HTTP request with a signed request, so you'll probably find the log
You can see that this is not just one request, but rather around 9 requests until it gets a result. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
@Madrigal - You are correct. Here is the updated code showing the correct way to check for no instances found
|
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
When attempting to get descriptions of instance types with a filter the response from the GO SDK differs from the AWS CLI response.
Take the code snippet:
Where the iType is
m6i.16xlarge
, the GO SDK will get no match, while the AWS CLI will get a matchRunning DEBUG mode for both I noticed that the GO SDK sends the request body as
application/x-www-form-urlencoded
encoded.The issue seems to be the full stop
.
in the filter value. For example is the value werem6i*xlarge
the response would be the same.I ran the --debug on the command line version but that does not output the raw request body, so I'm unable to determine what the differences are in the request to the AWS API.
Regression Issue
Expected Behavior
I would expect the GO SDK to return the same data that the AWS CLI does.
Current Behavior
GO SDK get no matches back
Reproduction Steps
Using this snippet of code, testing a few values for
iType
m6i.16xlarge
- Nothing foundm6i*16xlarge
- Nothing Found*16xlarge
- Nothing foundm6i*
- List foundIn all cases the command line tool returns an instance-type
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.23.2 linux/amd64
Operating System and version
Centos 7
The text was updated successfully, but these errors were encountered: