13

aws cli : Listing Lambda functions and filtering with jq

 3 years ago
source link: https://www.kevinhooke.com/2021/07/17/aws-cli-listing-lambda-functions-and-filtering-with-jq/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

aws cli : Listing Lambda functions and filtering with jq

‘aws lambda list-functions’ returns function details in your current region, but the info is sometimes too verbose when you’re looking for a list of names:

{
    "Functions": [
{
    "FunctionName": "example1",
    "FunctionArn": "arn:aws:lambda:us-west-2:111111111:function:example1",
    "Runtime": "java8",
    "Role": "arn:aws:iam::111111111:role/example-role",
    "Handler": "package.YourHandler::myHandler",
    "CodeSize": 3381385,
    "Description": "",
    "Timeout": 6,
    "MemorySize": 1024,
    "LastModified": "2021-01-13T08:18:33.727+0000",
    "CodeSha256": "aaabbbccc=",
    "Version": "$LATEST",
    "TracingConfig": {
      "Mode": "PassThrough"
    },
    "RevisionId": "aa-bb-cc-dd"
  },
  {
    "FunctionName": "example2",
    "FunctionArn": "arn:aws:lambda:us-west-2:111111111:function:example2",
    "Runtime": "java8",
    "Role": "arn:aws:iam::111111111:role/example-role",
    "Handler": "package.YourHandler2::myHandler",
    "CodeSize": 3381385,
    "Description": "",
    "Timeout": 6,
    "MemorySize": 1024,
    "LastModified": "2021-01-13T08:18:33.727+0000",
    "CodeSha256": "aaabbbccc=",
    "Version": "$LATEST",
    "TracingConfig": {
      "Mode": "PassThrough"
    },
    "RevisionId": "aa-bb-cc-dd"
  }
]
}

Passing this into JQ you can filter to display any of the properties easily with patterns like:

aws lambda list-functions | jq '.Functions[].FunctionName

CategoriesKev's BlogTagsaws, lambda, shell

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

Notify me of follow-up comments by email.

Notify me of new posts by email.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK