AWS CLI执行lambda函数问题

And*_*gel 4 amazon-web-services aws-cli aws-lambda

我正在尝试从Windows 10中的AWS CLI调用lambda函数.我以前通过AWS configure完成了我的客户端配置.

使用的命令是:

aws lambda invoke \
    --function-name arn:aws:lambda:us-east-1:111111111:function:xxx \
    --invocation-type RequestResponse
Run Code Online (Sandbox Code Playgroud)

但我的系统返回错误aws: error: too few arguments,如下所示:

在此输入图像描述

你们可以指导我在这次执行中取得成功吗?

谢谢

jar*_*mod 13

看起来你需要提供一个outfile.所以重新运行如下:

aws lambda invoke \
    --function-name arn:aws:lambda:us-east-1:111111111:function:xxx \
    --invocation-type RequestResponse \
    outfile.txt
Run Code Online (Sandbox Code Playgroud)


Put*_*nik 7

除了@jarmod的答案:-如果要直接将输出发送到stdout,则可以使用:

aws lambda invoke --function-name my_function --invocation-type RequestResponse --log-type Tail - | grep "LogResult"| awk -F'"' '{print $4}' | base64 --decode

或者如果您有jq

aws lambda invoke --function-name my_function --invocation-type RequestResponse --log-type Tail - | jq '.LogResult' -r | base64 --decode