LoginSignup
2
0

More than 3 years have passed since last update.

[awscli] nodejs8.10を使用しているlambdaを洗い出すワンライナー

Last updated at Posted at 2019-11-19

モチベーション

AWS Lambda: Node.js 8.10 is EOL, please migrate your functions to a newer runtime version. らしいので、nodejs8.10を使ってるlambda関数を洗い出したかった

https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/runtime-support-policy.html
https://qiita.com/kapioz/items/1e0fb80afc7d98bbde52

ワンライナー

aws lambda list-functions | jq -r ('.Functions'|.[]|'{ FunctionName: .FunctionName, Runtime: .Runtime}') | jq -r 'select(.Runtime == "nodejs8.10")'

こっちだと関数名のみ

aws lambda list-functions | jq -r ('.Functions'|.[]|'{ FunctionName: .FunctionName, Runtime: .Runtime}') | jq -r 'select(.Runtime == "nodejs8.10")' | jq '{ FunctionName: .FunctionName } | .FunctionName' -r

結果

$ aws lambda list-functions | jq -r ('.Functions'|.[]|'{ FunctionName: .FunctionName, Runtime: .Runtime}') |  jq -r 'select(.Runtime == "nodejs8.10")'
{
  "FunctionName": "hoge",
  "Runtime": "nodejs8.10"
}
{
  "FunctionName": "piyo",
  "Runtime": "nodejs8.10"
}
{
  "FunctionName": "wow",
  "Runtime": "nodejs8.10"
}
{
  "FunctionName": "yeah",
  "Runtime": "nodejs8.10"
}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0