Replies: 1 comment 12 replies
-
If you're using APIGW Rest, you probably need to return a ProxyResponse object: https://github.com/LegNeato/aws-lambda-events/blob/master/aws_lambda_events/src/apigw/mod.rs#L60 If you're using APIGW Http, you probably need to return a HttpResponse object: https://github.com/LegNeato/aws-lambda-events/blob/master/aws_lambda_events/src/apigw/mod.rs#L295 |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
we have 2 libs:
And you cannot mix them, and I have a third case, which I can only solve with lambda_runtime trying to return a lambda_http response.
PROBLEM:
My APIGW has a Lambda Request Authorizer. The output of the Authorizer is a context, for example:
context: { email: [email protected] }
To pass the context to Lambda, you must disable the LambdaProxy and create an integration template.
Using the default one from AWS, I end up having a payload that is not compatible with the types of lambda_http
Because of this, I need to create my custom structure and switch to lambda_runtime.
LINKS:
using lambda_http:
I get this error:
ERROR lambda_runtime: Error("data did not match any variant of untagged enum LambdaRequest", line: 0, column: 0)
using lambda_runtime:
The problem is the response. End of the day, I need to return something like the:
If I use:
serde_json::from_str(response)?
It will return all as JSON in the body, and so it will skip the headers (see images)
Question is:
If I return
Result<Response<String>, Error
lambda_runtime complainBeta Was this translation helpful? Give feedback.
All reactions