Официальный блог AWS опубликовал объявление под названием Анонсирование конца поддержки Python 2.7 в AWS LAMBDA .
В сообщении есть команда CLI AWS, которая спистроет функции Lambda Python 2.7.
aws lambda list-functions --function-version ALL --output text --query "Functions[?Runtime=='python2.7'].FunctionArn"
Вот оболочка для запуска его команды во всех регионах.
Сценарий (list-py27functions.sh)
for region in `aws ec2 describe-regions --query "Regions[].RegionName" --region us-west-1 --output text` do echo "[${region}]" aws lambda list-functions --region ${region} --output text --query "Functions[?Runtime=='python2.7'].{ARN:FunctionArn, Runtime:Runtime}" done echo "finished"
использование
export AWS_PROFILE=xxxx # Not necessary if you always set the default profile. sh list-py27functions.sh
Вывод
[eu-north-1] [ap-south-1] [eu-west-3] [eu-west-2] [eu-west-1] [ap-northeast-3] [ap-northeast-2] [ap-northeast-1] arn:aws:lambda:ap-northeast-1:111111111111:function:xxxxx python2.7 arn:aws:lambda:ap-northeast-1:111111111111:function:yyyyy python2.7 [ca-central-1] [ap-east-1] [ap-southeast-1] [ap-southeast-2] [eu-central-1] [us-east-1] arn:aws:lambda:us-east-1:111111111111:function:test python2.7 [us-east-2] [us-west-1] [us-west-2] arn:aws:lambda:us-west-2:111111111111:function:zzzz python2.7 finished
Вы также можете запустить его из Cloudshell, не указав профиль.
Анонсирование конца поддержки Python 2.7 в AWS Lambda AWS CLI:: Список-функции AWS CLI:: Описанные-регионы AWS CLI:: Фильтрация
Оригинал: “https://dev.to/cof123/listing-of-aws-lambda-python-2-7-functions-that-will-be-eol-across-all-regions-2khd”