Bootstrap FreeKB - Amazon Web Services (AWS) - List Lambda Functions using the AWS CLI
Amazon Web Services (AWS) - List Lambda Functions using the AWS CLI

Updated:   |  Amazon Web Services (AWS) articles

This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws lambda list-functions command can be used to list the Lambda Functions you have created.

aws lambda list-functions

 

And here is an example of how to limit the output using the --query option.

aws lambda list-functions --query 'Functions[?FunctionName==`myfunction`]'

 

Something like this should be returned.

{
    "Functions": [
        {
            "TracingConfig": {
                "Mode": "PassThrough"
            },
            "Version": "$LATEST",
            "CodeSha256": "/ur2jHd199ldQbP+Y20sw3kIHhaWwnPY6CQvSwZ6Kco=",
            "FunctionName": "myfunction",
            "MemorySize": 128,
            "RevisionId": "741c094a-cff2-4cdb-a5b6-110a900e1a43",
            "CodeSize": 529507,
            "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:myfunction",
            "Handler": "app.lambda_handler",
            "Role": "arn:aws:iam::123456789012:role/myfunction",
            "Timeout": 3,
            "LastModified": "2023-11-16T02:52:04.978+0000",
            "Runtime": "python3.9",
            "Description": ""
        }
    ]
}

 

The aws lambda get-function command can be used to list a specific function, including the function location.

~]$ aws lambda get-function --function-name myfunction
{
    "Code": {
        "RepositoryType": "S3",
        "Location": "https://prod-04-2014-tasks.s3.us-east-1.amazonaws.com/snapshots/713542074252/myfunction-dcf3f554-6f77-440a-a8c8-8d95376a473a?versionId=_7iwZAkyxad1zLLfEnT4PQbq6S1I.tjR&X-Amz-Security-Token=IQoJb3JpZ2lu.....bb9e"
    },
    "Configuration": {
        "Layers": [
            {
                "CodeSize": 393575,
                "Arn": "arn:aws:lambda:us-east-1:123456789012:layer:paramiko:1"
            }
        ],
        "TracingConfig": {
            "Mode": "PassThrough"
        },
        "Version": "$LATEST",
        "CodeSha256": "5kHtMyCmdf31fSnR+BaNYhOn59MQp20WHvTJD9W6bCI=",
        "FunctionName": "myfunction",
        "LastUpdateStatus": "Successful",
        "MemorySize": 128,
        "RevisionId": "194909d6-a542-4341-a17f-9c5efbb49e81",
        "CodeSize": 1819,
        "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:myfunction",
        "State": "Active",
        "Handler": "lambda_function.lambda_handler",
        "Role": "arn:aws:iam::123456789012:role/service-role/paramiko-role-lv0c9ra5",
        "Timeout": 3,
        "LastModified": "2023-12-15T02:01:18.000+0000",
        "Runtime": "python3.11",
        "Description": ""
    }
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 2bcdfe in the box below so that we can be sure you are a human.