Closed xanderbilla closed 1 year ago
Hi @xanderbilla 👋 thanks for raising this issue. Which version of node is your lambda running? If 18, I think the version of the aws-sdk (v3) requires that you import scoped packages such as @aws-sdk/lib-dynamodb
or @aws-sdk/client-xxx
. So I think you might either have to simply change the package you're importing or downgrade your node version to 16 for aws-sdk v2 to be included in the build.
For more information:
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/#generated-code
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
REST API
Amplify Categories
auth, storage, api
Environment information
Describe the bug
Hello dev,
I initialized aws amplify application with default configuration.
After that I added Storage (Dynamo DB) and added some column and also GSI and sort key
After that I added api where I created new lambda function and also added the DynamoDB table in that function. After pushing the code I tested API (with default written function) it worked fine for all methods (get, post)
But, when I made some changes like adding item and retrieving item from table in lambda function and tested it returns 502 error
I have also provided the API logs but it's saying aws-sdk not found to some unknown module
Expected behavior
The expected behvior is it should work for post and get method
Reproduction steps
While using the methods it appears with status code 502
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response