I am trying to use the below aws cli command to invoke the lambda function.
aws lambda invoke --invocation-type RequestResponse --function-name HelloWorldJava --payload "world" outputfile.txt
But Iam getting below error.
Invalid base64: ""world""
The book I am referring to is using the same method.
3
Answers
You need to pass payload as a json-string – https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html#examples
Your payload has to be JSON according to the docs, but I think there is no hard requirement for that. When you want to pass in a string value directly (JSON or otherwise) you also need to be sure that you pass
--cli-binary-format raw-in-base64-out
.So you command should be:
Configurations
Error
--payload
(blob)source
Correction
you need to clarify with this command:
Method
Run this code
Run your code again