I just experimented with deploying python lambdas....
# sst
l
I just experimented with deploying python lambdas. First did a
npx create-serverless-stack@latest [proj nam] --language python
and it worked as expected, creating a JavaScript
MyStack
and a Python lambda (
lambda.py
). All good. Then I did an
npx sst start
and then checked out what goodies I made in the AWS console. I see that my Lambda got created, it's in JavaScript in the console (no Python runtime Lambdas created). Is sst converting from Python to JavaScript?
t
The stub lambda that forwards to your local machine is in js
It's a bit unexpected haha I've had a few people ask that
l
Yeah, the stub Lamba being a
.js
makes sense. Funny that I can't find any Lamda in the console with a Python runtime.
They're all
Node.js12.x
And it works as expected when invoked from the API endpoint. (As expected by what the Python code says in
lambda.py
)
I called my project
sst-lambda-no-dep
when I initialized with the npx sst command, didn't change any code. My Lambda name I believe is correct is
dev-sst-lambda-no-dep-my-stac-ApiLambdaGETB1714EF3-HDWlA5omXDMY
and it's a
Node.js12x
runtime and the code in the console is Javascript.
t
When running SST start all functions will be js
Because they're not actually running your code, they're just forwarding to your local machine
l
...and then the world made sense. I see where I am - thanks!
t
This is actually my favourite bit of the black magic that SST is doing - I love looking at people's faces when I explain to them that the whole project gets deployed to cloud (CDN, api gateway, s3, whateva) - and yet - the lambas code is running from your local machine... 😄