If invoking your Lambda function from the command-line, another reason for event
being empty could be a change between the v1 and v2 of AWS CLI. Compare:
Where in AWS CLI v1 you could do:
invoke
aws lambda invoke \
--function-name LambdaPhono \
--invocation-type Event \
--payload file://inputFile.txt \
outputfile.txt
In AWS CLI v2 you need to do:
invoke
aws lambda invoke \
--function-name LambdaPhono \
--cli-binary-format raw-in-base64-out \
--invocation-type Event \
--payload file://inputFile.txt \
outputfile.txt
Mind the new --cli-binary-format raw-in-base64-out
option in v2.
This is documented here: https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam