aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.66k stars 3.92k forks source link

(APIGatewayv2.websocket: add support for HTTP integration #29562

Open cloudshiftchris opened 7 months ago

cloudshiftchris commented 7 months ago

Describe the feature

Presently the WebSocketApi construct supports lambda, AWS and Mock integrations; add support for HTTP integration; effectively all available options in the GUI/CFN for this (proxy, vpc link, etc).

Use Case

Websocket messages being delivered to internal HTTP endpoints.

Proposed Solution

Add a new WebSocketHttpIntegration implementation of WebSocketIntegration

Other Information

No response

Acknowledgements

CDK version used

2.132.0

Environment details (OS name and version, etc.)

MacOS

nmussy commented 7 months ago

Associated documentation/API:

Current CDK implementation:

Both WebSocketIntegrationType.HTTP and WebSocketIntegrationType.HTTP_PROXY are currently missing, as well as their associated WebSocketRouteIntegration implementations

pahud commented 7 months ago

@cloudshiftchris Thank you for the report.

@nmussy Thank you for your PR! This is awesome!

nmussy commented 7 months ago

The PR I've opened doesn't address this specific issue, but will add properties that are also used by the HTTP integrations. I'll take care of them later if no one else takes them on 👍

nmussy commented 7 months ago

Progress report: I got things mostly figured out for the HTTP integrations. One thing I did notice was the lack of proper support for CfnIntegrationResponse, which is essential if you want to receive the response of an HTTP integration. So I'm going to open another PR to implement them as well, wait for that to be merged, and then #29589 should be good to go 👍

nmussy commented 6 months ago

Just as an FYI, I haven't forgotten about this issue. The PR was closed for inactivity, but I'm waiting for #29661 to be reviewed and merged so I can finalize the integ tests for #29589

dtczest commented 5 months ago

Just +1ing this issue. Thanks for the work on this.

zscgeek commented 3 months ago

Watching - this would be a huge help for me.

alpinisme commented 3 months ago

Has anyone managed to achieve this even with an L1 construct? We're looking to do an http integration at my work as well.

mjshea-ryoma commented 2 months ago

+1 as well. This is a pretty significant gap in CDK feature parity.