-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(apigateway): support response streaming with response transfer mode #36155
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
| if ( | ||
| options.responseTransferMode === ResponseTransferMode.STREAM && | ||
| ![IntegrationType.AWS_PROXY, IntegrationType.HTTP_PROXY].includes(props.type) | ||
| ) { | ||
| throw new UnscopedValidationError(`ResponseTransferMode STREAM is only supported for AWS_PROXY and HTTP_PROXY integration types, got: ${props.type}`); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise the following errors occur.
ResponseTransferMode STREAM is not supported for AWS IntegrationTypeResponseTransferMode STREAM is not supported for HTTP IntegrationTypeResponseTransferMode STREAM is not supported for MOCK IntegrationType
You can only use response payload streaming for HTTP_PROXY or AWS_PROXY integration types.
alvazjor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the contribution
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #36156.
Reason for this change
AWS announced support for response streaming in Amazon API Gateway to significantly improve the responsiveness of your REST APIs by progressively streaming response payloads back to the client.
see: https://aws.amazon.com/blogs/compute/building-responsive-apis-with-amazon-api-gateway-response-streaming/
This feature uses the
responseTransferModeparameter for integrations.see: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-apigateway-method-integration.html#cfn-apigateway-method-integration-responsetransfermode
Description of changes
Added
responseTransferModetoIntegrationOptions.Also, in the case of Lambda integrations, the URI path changes for streams (for example:
arn:aws:apigateway:${APIGW_REGION}:lambda:path/2021-11-15/functions/${FN_ARN}/response-streaming-invocations), so I changed that inLambdaIntegrationas well.ref:
Note the /response-streaming-invocations Uri fragment, it tells API Gateway to use the Lambda [InvokeWithResponseStreaming](https://docs.aws.amazon.com/lambda/latest/api/API_InvokeWithResponseStream.html) endpoint:Describe any new or updated permissions being added
Description of how you validated changes
Both unit tests and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license