Skip to content

Conversation

@go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Nov 22, 2025

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 responseTransferMode parameter 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 responseTransferMode to IntegrationOptions.

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 in LambdaIntegration as well.

    const path = options.responseTransferMode === ResponseTransferMode.STREAM
      ? `2021-11-15/functions/${handler.functionArn}/response-streaming-invocations`
      : `2015-03-31/functions/${handler.functionArn}/invocations`;

ref:

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

@github-actions github-actions bot added the p2 label Nov 22, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 22, 2025 14:04
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Nov 22, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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)

@aws-cdk-automation aws-cdk-automation dismissed their stale review November 22, 2025 14:43

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@github-actions github-actions bot added the feature-request A feature should be added or improved. label Nov 22, 2025
@go-to-k go-to-k marked this pull request as draft November 22, 2025 15:13
@go-to-k go-to-k marked this pull request as ready for review November 22, 2025 15:22
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 22, 2025
Comment on lines +248 to +253
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}`);
}
Copy link
Contributor Author

@go-to-k go-to-k Nov 22, 2025

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 IntegrationType
  • ResponseTransferMode STREAM is not supported for HTTP IntegrationType
  • ResponseTransferMode STREAM is not supported for MOCK IntegrationType

ref: https://docs.aws.amazon.com/apigateway/latest/developerguide/response-transfer-mode.html#response-transfer-mode-considerations

You can only use response payload streaming for HTTP_PROXY or AWS_PROXY integration types.

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Nov 23, 2025
@alvazjor alvazjor self-assigned this Nov 24, 2025
alvazjor
alvazjor previously approved these changes Nov 25, 2025
Copy link
Contributor

@alvazjor alvazjor left a 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

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

Merge Queue Status Beta

🚫 The pull request has left the queue (rule: default-squash)

This pull request spent 54 minutes 29 seconds in the queue, with no time waiting for CI.
The checks were run in-place.

Required conditions to merge

Reason

The merge conditions cannot be satisfied due to failing checks

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

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).

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

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).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 25, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

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).

@mergify mergify bot dismissed alvazjor’s stale review November 25, 2025 15:47

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 1 hour 14 minutes 22 seconds in the queue, including 41 minutes 15 seconds waiting for CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

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).

@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2025

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).

@mergify mergify bot merged commit f431021 into aws:main Nov 25, 2025
19 of 20 checks passed
@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(apigateway): support response streaming

4 participants