2020年5月6日水曜日

AWS lambdaの簡単な環境構築_CLI

ほとんどAWSのサイトに書いてあるので、リンクだけまとめます。

AWSの登録、IAMの設定は省略。

AWS CLIの環境構築
https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-chap-welcome.html

Lambdaの操作方法
https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/gettingstarted-awscli.html

ケアレスミスで躓いたこと。

$ aws lambda list-functions --max-items 10

Could not connect to the endpoint URL: "https://lambda.us-east2.amazonaws.com/2015-03-31/functions/"

regionの設定をミスってしまったため、コマンド発行が失敗しました。

補足:上記リンクにはupdate-function-codeがなかったので、以下のように更新します。

 aws lambda update-function-code --function-name hello-world  --zip-file fileb://function.zip