APIGW NG implement AWS bug for INTEGRATION_FAILURE GatewayResponse #11183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
While implementing the
AWS_PROXY
integration with #11167, I've stumbled onto a weird issue: AWS would raise anINTEGRATION_FAILURE
error, which the default status code should be 504 (Gateway Timeout, that's already suspicious), but instead returned500
.After a lot of investigation with @cloutierMat, we came to the conclusion that the CRUD later (
PutGatewayResponse
,GetGatewayResponse
etc) is not in line with the actual behavior, and that the actual default status code is500
, but the CRUD calls still returns 504.This PR implements the logic to enable the difference between the CRUD layer and the actual invocation layer by attaching a default status code to the exception, while still using the previous default for other exceptions, allowing us to override the behavior.
This behavior is validated by
tests.aws.services.apigateway.test_apigateway_lambda.test_lambda_aws_proxy_integration_non_post_method
.Changes