-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(@aws-cdk/aws-apigatewayv2-alpha): Cannot get API Gateway to trigger connect or disconnect #19532
Comments
Typescript version is 4.5.5 |
A bit of an update... if I remove the (dis)connectRouteOptions, I can add these routes using the AWS console as a workaround. |
Hi @ryparker, I think the issue goes beyond the AWS console as I was also unable to wscat -c to the endpoint. |
Thanks @Spider-ant, I'll see if I can codify it with the lambda arn next time I build a stack |
any updates on this ? having the same error |
Same here, the generated template as the following permissions: "websocketapitestwebsocketapiconnectRoutedefaultwebsocketroutePermission": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"Action": "lambda:InvokeFunction",
"FunctionName": {
"Fn::GetAtt": [
"websocketapiMyLambda",
"Arn"
]
},
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:us-east-2:*********:",
{
"Ref": "websocketapitestwebsocketapi"
},
"/*/*$connect"
]
]
}
} I think one of the /* before the $connect should not be there, this makes the aws-apigateway unusable. I ended up using the Cloudformation contruct instead of the higher level L2 Construct here are the required steps for it: #2872 (comment) |
Same problem here with version 2.86 |
Same problem in CDK v1. |
this issue has been open for 16 months, are there no plans to resolve this and make the L2 construct usable? If not, can we mark the construct as broken so people don't waste their time using it over the L1 constructs? |
I am also experiencing this issue and have wasted a bit of time troubleshooting my lambda when it never triggers to begin with due to this bug. Will switch to a different construct, but its unfortunate this has been open for so long without marking the construct as broken |
… 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*
|
What is the problem?
Not sure if the problem is with my code, the documentation or the implementation. After deploying the stack, the AWS console correctly displays an API Gateway trigger at the page Lambda>Functions>connect>Configuration>Triggers, however, the following is also displayed:
API Gateway:
arn:aws:execute-api:eu-west-1:1234567890:7sfj6g3ekl//$connect
x The API with ID 7sfj453ekl doesn’t include a route with path /* having an integration arn:aws:lambda:eu-west-1:1234567890:function:process_connect_requests.
If I'm doing something wrong, it's probably in the following lines:
Reproduction Steps
Please use the typical example connect/disconnect code
What did you expect to happen?
Something like the following to be displayed in Lambda>Functions>connect>Configuration>Triggers
API Gateway: WSM
arn:aws:execute-api:eu-west-1:1234567890:cogh633tqf/*/$connect
API endpoint: https://cogh633tqf.execute-api.eu-west-1.amazonaws.com/prod/
Details
API type: WEBSOCKET
Authorization: NONE
Method: $connect
Stage: prod
What actually happened?
wscat cannot connect
CDK CLI Version
2.17.0 (build f9cd009)
Framework Version
No response
Node.js Version
v16.13.0node.js
OS
Linux Mint
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: