pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
459 stars 155 forks source link

Default Node runtime for lambdaMixins is out of LTS (and marked as EOL) #4134

Closed EvanBoyle closed 1 month ago

EvanBoyle commented 3 months ago

Lambda mixins (magic functions) default to running Node v16 which has been EOL for 9 months.

https://github.com/pulumi/pulumi-aws/blob/896ae14c62ab8527923fcda571d0e3187a440d01/sdk/nodejs/lambda/lambdaMixins.ts#L415C38-L415C56

I discovered this by trying to use fetch within an snsTopic.onEvent handler. The lambda threw an error at runtime that fetch wasn't defined. Of course, fetch was only adding in node v18.

Would probably be wise to update the default to the current LTS (v18).

t0yv0 commented 3 months ago

Thanks so much for the issue report @EvanBoyle - my team will have a look as time permits. Digging through the test suite I note that while we have TestAccTopic written and passing, it does not exercise the Callback lambda end-to-end which might explain slipping issues like this one.

lukehoban commented 2 months ago

Notably - Node.js 16 was deprecated by AWS Lambda 5 weeks ago on June 12 (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported).

I expect our policy should be to bump the default version forward when AWS deprecates runtimes. This can of course be a breaking change, but it would be an even greater breaking change if we waited for AWS themselves to prevent deploying, so it feels like this policy balances not pushing people to new versions too fast with ensuring they are pushed before they have no choice so they can manage the migration.

mikhailshilkov commented 1 month ago

This issue has been addressed in PR #4348 and shipped in release v6.49.0.