Search code examples
amazon-web-servicesgit-bashaws-sam-cli

sam local invoke from pure stdin


with --help i can see

Invoking a Lambda function using input from stdin

$ echo '{"message": "Hey, are you there?" }' | sam local invoke "HelloWorldFunction" --event -

And it works as such. But trying to make use of stdin without piping an echo:

sam local invoke "HelloWorldFunction" --event -

it just lets me write without end. I've tried Ctrl+D but it just prints ^D

And of course Ctrl+C aborts the command without executing.

How can I use pure stdin for it? How can i signal the end of input?

note: i'm using git bash for windows 10.


Solution

  • ENTER then CTRL+Z then ENTER (again) will send an EOF in Windows.