Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 9008

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

$
0
0

モチベーション

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"
}

Viewing all articles
Browse latest Browse all 9008

Trending Articles