AWS Lambda runtime change script
              
          2023. 11. 6. 18:03ㆍAWS/AWS Lambda
728x90
    
    
  SMALL
    - 개요
AWS Lambda functions의 runtime version을 확인하고 일괄 변경하는 스크립트를 정리해봤다. 최근 Lambda runtime python3.7이 deprecated(2023년 11월 27일)가 될 시기에 맞아서 3.7에서 3.9로 변경하는 스크립트를 간단히 예시로 정리해봤다.
- 스크립트
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
- 결과
<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
- 참고
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
https://repost.aws/questions/QUKthaOaroTtaGRQ4ZNjRwDw/script-to-update-python-runtime-from-3-6-to-3-9-in-lambda-functions
728x90
    
    
  LIST
    'AWS > AWS Lambda' 카테고리의 다른 글
| Lambda 에서 X-Ray 활성화 하는 방법 (0) | 2024.04.01 | 
|---|---|
| Lambda edge functions list 확인 하는 방법 (0) | 2023.10.27 | 
| lambda 413 error (0) | 2023.01.27 | 
| lambda excute role template (0) | 2022.11.15 | 
| AWS Lambda functions description (0) | 2022.07.26 |