Last night @davidwells showed me some Serverless tricks. #200wordsTIL
Serverless, if you don't know is a framework thingy that makes it easier to use AWS services. In particular the whole serverless lambda function ecosystem.
Instead of futzing around with Amazon's for engineers by engineers impossible to understand dashboard, you write a serverless.yml file and Serverless handles the rest.
serverless.yml means your infrastructure is under git version control too, not just your code. Very powerful.
Plus you can deploy both code and infrastructure updates with `serverless deploy` 👌
So the first trick @davidwells showed me was that you can follow logs from your Lambda function. No need to go see on AWS dashboard.
sls logs -f <func name> -t
That didn't work for me so he showed me another trick: Last N minutes of logs
sls logs -f <func --startTime 2m
Logs have a delay sometimes. You have to try a few times before you get the latest logs. Never more than a few seconds, I'm just impatient.
Then there's also a faster way to deploy. Pushes just the code changes I'm told.
`sls deploy function -f privateEndpoint`