https://serverless-stack.com/ logo
#sst
Title
# sst
j

Jason

02/24/2022, 7:47 PM
There's some lambda layers released that allow you to have a runtime greater than 14 https://github.com/fusebit/everynode I'm trying to use it in sst but it requires I use
runtime: lambda.Runtime.PROVIDED
but
sst.Function
doesn't allow it. Is there some workaround I can do apart from just using the cdk constructs directly? I really need to use node v16... I'm guessing provided runtimes aren't allowed because of the local dev stuff but if it's node I think it shouldn't make a difference?
f

Frank

02/24/2022, 11:22 PM
I see. Yeah that makes sense. If the
PROVIDED
runtime is Node, Live Lambda debug should just work.
Let me put this on the roadmap… we might not be able to get to this right away.
j

Jason

02/25/2022, 8:58 AM
Thanks @Frank. Is it possible to put in a quicker fix that allows it when enableLiveDev is false? Just so we can take advantage of the bundler
f

Frank

02/25/2022, 5:16 PM
Can you try setting the function as
nodejs14.x
with the everynode layer, and then update the runtime manually after the function is bundled? ie.
Copy code
const myFn = new sst.Function(this, "MyFunction", { ... });
myFn.node.defaultChild.runtime = "provided";

// or in Typescript
(myFn.node?.defaultChild as lambda.CfnFunction).runtime = "provided";
j

Jason

03/08/2022, 7:06 PM
I have moved onto something else for now so couldn't test extensively but it looked like the above method of updating the runtime manually after works. It didn't work in the sst console, I couldn't see logs, but there were no build or deployment errors