Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

モチベーション

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"
}
dharada1
eure
オンラインデーティングサービス「Pairs」の運営・開発をしている企業。様々なモダンな技術を駆使してビジネスを成長させています。
https://eure.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away