Table of Contents
Open Table of Contents
Video Outline:
-
Demonstrate by showing the
Apiconstruct and pull up one of the lambda handlers.- Start up sst
- Invoke a function
- Make a change
- Invoke immediately
- Profit
-
Explain why this is so amazing.
-
I already touched on some of these things in the introduction video
-
Working on lambda can be really painful
-
I used to use Serverless Framework and they had a feature called serverless offline. I found it really difficult to work with sometimes (I honestly don’t remember the exact problems, just the lingering memory of pain). But it had shortcomings, and I personally found it more effective to create my own mock events and just pass in the mocks to my functions to test them out.
-
Another tactic I used was to only deploy the lambda function I was currently working on. This made it so I could deploy and test a function without deploying the entire stack.
You could get similar functionality with AWS SAM CLI, which can detect local changes to your lambda code and immediately sync your changes to the cloud.
And AWS CDK has a watch mode that does essentially the same thing.
However, you still have to wait for the update to occur in the cloud. Even if it’s only a few seconds, it can still be frustrating.
-
-
Check out the Advantages section in docs.
- The docs say it supports Lambda “IAM permissions”, but from what I can tell this isn’t true. If I’m totally missing something and you’re from the SST team, please correct me in the comments.
-
Uses AWS IoT, which is completely serverless. This means it’s very cost effective.
-
Bonus Tips:
-
I keep getting warning that
sst envhas been replaced bysst bind. But what does it do?Demonstrate by doing
pnpm sst bind shand displaySST_env vars. -
NEED to talk about the new
ContextAPI!