AWS Lambda runtime change script

AWS/AWS Lambda

·

1 min read

  • outline

Script for check and change runtime version of AWS Lambda functions. Below is example for chainging python 3.7 to 3.9..

  • script
for i in $(aws lambda list-functions --function-version ALL --region ap-northeast-2 --output text --query "Functions[?Runtime=='python3.7'].FunctionName"  --output text)
do
        res=$(aws lambda update-function-configuration --function-name "$i" --runtime python3.9 --output text --query "Runtime")
        echo "$i" is successfully updated to "$res"
done
  • output
<Lambda function a> is successfully updated to python3.9
<Lambda function b> is successfully updated to python3.9
<Lambda function c> is successfully updated to python3.9
<Lambda function d> is successfully updated to python3.9
  • reference

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
repost.aws/questions/QUKthaOaroTtaGRQ4ZNjRw..