Here at Lumigo, we are big fans of serverless. And a big part of working with AWS Lambda involves using many other AWS services. For example, services such as SNS and SQS are often used to chain Lambda functions together. They are essential ingredients of an event-driven architecture, where systems are loosely coupled through events.
However, they also pose a challenge to how we test our systems and how to get fast feedback on what’s happening in the system. For a long time, I have wished there was a CLI tool to ease a number of my daily inconveniences, such as
Which is why I’m happy to tell you about the lumigo-cli, a collection of useful tools that makes your serverless development flow easier.
The lumigo-cli lets you see all your Lambda functions, in every region, with the list-lambda command. It shows you high-level info about the functions, including when they were last modified and last used.
If you only want to see the inactive (not invoked for more than 30 days) functions, then you can set the -i flag.
In a similar vein, you can also analyze and estimate the cost of your Lambda functions in all regions using the analyze-lambda-cost command.
The lumigo-cli also has a number of commands for tailing SNS, SQS, Kinesis Streams and DynamoDB Streams. Which makes it easy for you to “listen in” on the events that are flowing through your system (as both input and output of your Lambda functions).
For instance, I can tail the events from a DynamoDB Stream by running the “tail-dynamodb” command as you can see below.
It’s an operational best practice to configure a DLQ to capture SQS messages that fail persistently. However, once the issue that caused these messages to fail has been addressed, you also need a way to reprocess thoese failed messages. This is often a manual and cumbersome process. Which is why we also included a useful command to replay these DLQ’d messages back to the main queue.
And that’s not all. We also have other commands that are useful in a number of situations:
I hope you find these commands useful in your day-to-day work. Please give lumigo-cli a try and let us know your thoughts. If you have ideas or suggestions for new commands, please let us know by raising a feature request here.