Amazon AWS CLI not allowing valid JSON in payload parameter

后端 未结 2 488
野趣味
野趣味 2021-01-01 09:38

I am getting an error when I try and invoke a lambda function from the AWS CLI. I am using version 2 of the CLI. I understand that I should pass the --payload a

2条回答
  •  爱一瞬间的悲伤
    2021-01-01 10:17

    As @MCI said, AWS V2 defaults to base 64 input. For your case to work, simply add a --cli-binary-format raw-in-base64-out parameter to your command, so it'd be

    aws lambda invoke --function-name testsms \
        --invocation-type Event \
        --cli-binary-format raw-in-base64-out \
        --payload '{"key": "test"}' response.json
    

提交回复
热议问题