Search code examples
amazon-web-servicesaws-lambdaaws-cli

Aws Lambda to List All Available Language Runtimes


I have a requirement where I want to make sure all individual Lambda functions are using the latest versions of the runtime.

Using CLI cmd: aws lambda get function I am able to get the runtime version of that particular lambda function but I want to make sure it is using the latest language version.

Going through the Aws Doc for Lambda https://docs.aws.amazon.com/cli/latest/reference/lambda am unable to find any API which can tell which all are available runtimes available and maybe from that list I can be able to determine which is the latest (maybe by checking the highest version number for that particular language).

So just wanted to know is there any AWS API that I failed to find or maybe some other way by which this can be achievable?

NOTE: I am not talking about the Lambda Function Versioning but about the language runtime version.
For, e.g., currently AWS lambda has Node.js 8.10 as the latest runtime. So if any Lambda function uses Node.js 6.10 as runtime, then I want to highlight that Lambda Function.


Solution

  • There is no official API call to obtain this information.

    I found the following in the botocore source code:

    "Runtime":{
      "type":"string",
      "enum":[
        "nodejs",
        "nodejs4.3",
        "nodejs6.10",
        "nodejs8.10",
        "java8",
        "python2.7",
        "python3.6",
        "python3.7",
        "dotnetcore1.0",
        "dotnetcore2.0",
        "dotnetcore2.1",
        "nodejs4.3-edge",
        "go1.x"
      ]
    },
    

    So, you could pull from that project on a regular basis to obtain a list of runtime versions.