You can use your current tty as the outfile, which allows command output to still be redirected:
> aws lambda invoke --function-name name --payload '{}' $(tty) >/dev/null
LAMBDA_OUTPUT
Using /dev/stdout
for the outfile sort of works. Issue #1: the command output gets mixed up with it:
> aws lambda invoke --function-name name --payload '{}' /dev/stdout
{ACTUAL_OUTPUT
"StatusCode": 200,
"ExecutedVersion": "$LATEST"
}
Issue #2: If you try to redirect the stdout then you've just directed the lambda result as well. You can at least separate them by piping to cat
:
> aws lambda invoke --function-name name --payload '{}' /dev/stdout | cat
ACTUAL_OUTPUT{
"StatusCode": 200,
"ExecutedVersion": "$LATEST"
}