概要
AWSからnode12がEOLになるので、nodejs12.xのlambdaを更新してくれとメールが来ていた。
11月になる前に対応したいので、cliを使って一括でnodejs16.xに更新した。
なお、cdkで作ったものは14.xを明示的に指定しているので、ここで更新が必要なものはCloudFormationが自動生成したLambdaであった。
メール
Hello,
We are contacting you as we have identified that your AWS Account currently has one or more Lambda functions using Node.js 12 runtime.
We are ending support for Node.js 12 in AWS Lambda. This follows Node.js 12 End-Of-Life (EOL) reached on April 30, 2022 [1].
As described in the Lambda runtime support policy [2], end of support for language runtimes in Lambda happens in two stages. Starting November 14, 2022, Lambda will no longer apply security patches and other updates to the Node.js 12 runtime used by Lambda functions, and functions using Node.js 12 will no longer be eligible for technical support. In addition, you will no longer be able to create new Lambda functions using the Node.js 12 runtime. Starting December 14, 2022, you will no longer be able to update existing functions using the Node.js 12 runtime.
We recommend that you upgrade your existing Node.js 12 functions to Node.js 16 before November 14, 2022.
End of support does not impact function execution. Your functions will continue to run. However, they will be running on an unsupported runtime which is no longer maintained or patched by the AWS Lambda team.
The following command shows how to use the AWS CLI [3] to list all functions in a specific region using Node.js 12. To find all such functions in your account, repeat this command for each region:
aws lambda list-functions --function-version ALL --region us-east-1 --output text --query "Functions[?Runtime=='nodejs12.x'].FunctionArn"
環境
- gitbash
- jq-1.6
- aws-cli/2.7.35 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
cli
aws lambda list-functions --query "Functions[?Runtime=='nodejs12.x'].FunctionName" | jq -r ".[]" | sed "s/^ *\\| *$//" | xargs -I{} aws lambda update-function-configuration --runtime nodejs16.x --function-name "{}"
参考
AWS Lambda のランタイムを変更する方法
list-functions
update-function-configuration