24
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AWS CLI v2にしたらlambda invokeがコケる

Posted at

現象

AWS CLI version 2でlambda invokeしたら、動くはずなのにコケる。payloadがおかしい?

$ aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json

Invalid base64: "{"key": "value"}"

解決策

--cli-binary-format raw-in-base64-out をつけましょう

原因

AWS CLI バージョン2では、パラメータはbase64エンコードが前提になったのでエラーになる。

AWS CLI バージョン 2 は、デフォルトではすべてのバイナリ入力パラメータとバイナリ出力パラメータを base64 エンコード文字列として渡すようになりました。

24
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?