Skip to content

Commit

Permalink
fix(apigatewayv2): trigger on websocket connect and disconnect is not…
Browse files Browse the repository at this point in the history
… working (#27732)

Closes #19532 

Lambda integrations for `$connect` and `$disconnect` routes were previously broken. Users would see this error message in the Lambda console:

![160185676-15ba5704-a7ba-49ef-b457-bb3f89094de6](https://github.com/aws/aws-cdk/assets/35242245/0938239a-b4f1-440d-9868-86ce3d213386)

Fixing the path by removing the extra `*/` from the [code of the Lambda integration](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts#L36) that adds permission, we no longer see that error message in the Lambda console as the path is now correct:

<img width="973" alt="Screenshot 2023-10-27 at 2 58 11 PM" src="https://github.com/aws/aws-cdk/assets/35242245/c5a8f1f6-4e51-4533-880e-3c5f400cc59e">

I could not manage to figure out how to verify this change via an Integration test assertion. However, I added a new integration test file for Lambda `$connect` and `$disconnect` integrations on a `WebSocketApi`. The attached screenshots above also verify that this change works when I manually run it locally.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
sumupitchayan authored Nov 1, 2023
1 parent 93c6a9a commit 89f4f86
Show file tree
Hide file tree
Showing 30 changed files with 1,915 additions and 124 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 89f4f86

Please sign in to comment.