I have written a Lambda function as Websocket and API Gateway using Serverless and Redis. Also using AWS-CLI to deploy project on AWS S3. I am receiving:
Task timed out after 6.01 seconds
Increasing the timeout or request size gives me the same message but with higher amount of timeout seconds. The strange thing is that it works locally, but not when it's deployed to AWS. Code should work. I think something is missing in AWS configurations.
I created separate VPC with 3 subnets: 2 private and 1 public. I created also NAT using public subnet Internet Network. I added route to 0.0.0.0/0. I maintained IAM Role to permit API execution etc.
It happens here:
return this.ws
.postToConnection({
ConnectionId: connId,
Data: payloadStr
})
Where ws is
this.ws = new ApiGatewayManagementApi({
apiVersion: '2018-11-29',
endpoint: endpoint
});
I checked connId and it's not null.
I update with schema how my network looks like:
