I was trying to work with AWS Lambda using the awscli on an ubuntu ec2 instance, and I do not have access to the aws console. Note that I am not using serverless or zapper, I di
Using the AWS CLI can be a bit irritating because the stream name changes as you modify your function. I've found that using awslogs (https://github.com/jorgebastida/awslogs) is a nicer workflow.
List the groups:
awslogs groups
Filter results.
awslogs groups|grep myfunction
Then get the logs from the group.
awslogs get /aws/lambda/ShortenStack-mutationShortenLambdaBC1758AD-6KW0KAD3TYVE
It defaults to the last 5 minutes, but you can add the -s parameter to choose a time, e.g -s 10m
for the last 10 minutes.
The output is colourised if you're at the terminal, or plain if you're piping it through other commands, e.g. grep to find something.