When I try to post to my lambda function url I get a very generic 502 internal server error.
I deployed the function with serverless and when I invoke it locally as well as just invoke the function with serverless from my terminal in vscode I get a successful return.
2
Answers
Im not 100% sure what ended up resolving the issue, but I think I was added more than one post method in the API gateway and calling the wrong one. I ran SLS remove and then SLS deploy and once done I was able to get the api calls to return the 200 status
Are you using API Gateway? I recommend looking at the AWS example photo asset management app that demonstrates how to invoke Lambda functions from a client app using API Gateway.
In addition, there is an AWS CDK script you can use to set up backend resources. Once done, you can run the app and look at the code.
See this doc topic in the AWS COde library:
Create a photo asset management application that lets users manage photos using labels