sst / sst

Build full-stack apps on your own infrastructure.
https://sst.dev
MIT License
22.14k stars 1.68k forks source link

Adding dynamodb linking to api gateway v2 route causes dev mode to hang #3954

Open tuokorDyme opened 1 month ago

tuokorDyme commented 1 month ago

When I run sst dev and try to call a lambda function that has a linked dynamodb table using api gateway route, it will always crash with internal server error. Cloudwatch logs show that somekind of timeout happens. I have tried to restart the sst numerous times and have updated sst to the lastest 3.2.19. Everything works if I deploy the code normally to a stage but not in dev mode. Also lambdas without dynamodb link work without problems. image

The table and gateway is defined like this:

export const eventsTable = new sst.aws.Dynamo('events', {
  fields: {
    pk: 'string',
    sk: 'string',

  },
  primaryIndex: { hashKey: 'pk', rangeKey: 'sk' }
});

const apiGateway = new sst.aws.ApiGatewayV2("FooApi", {
    cors: true
});

  apiGateway.route("GET /api/v1/event", {
    link: [eventsTable],
    handler: "packages/functions/src/events.get"
  });

If I create route without dynamodb link it will work on dev mode without problems. This issue didn't appear in version 3.1.51 but at least with versions >= 3.1.67 it happens.

jayair commented 1 month ago

That's strange, I'm not seeing this.

Can you try with the latest?