serverless / serverless

⚡ Serverless Framework – Use AWS Lambda and other managed cloud services to build apps that auto-scale, cost nothing when idle, and boast radically low maintenance.
https://serverless.com
MIT License
46.32k stars 5.69k forks source link

S3 event on existing bucket creates "old" nodejs16 function, should be configurable / up to date #12265

Open janik6n opened 8 months ago

janik6n commented 8 months ago

Is there an existing issue for this?

Use case description

When Lambda function is configured to use S3 event trigger (Nodejs20.x runtime) with existing bucket, the additional Lambda function described here https://www.serverless.com/framework/docs/providers/aws/events/s3 Using existing buckets is always created with nodejs16.x runtime.

Example configuration:

events:
      - s3:
          bucket: ${param:myBucket}
          event: s3:ObjectCreated:*
          rules:
            - suffix: .xml
          existing: true
          forceDeploy: true

The runtime for this additional function should be: a) configurable b) use ${self:provider.runtime} as default.

Nodejs 16 runtime will be deprecated next year (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), and I would like to have my function runtimes up to date.

Proposed solution (optional)

No response

Ojka91 commented 6 months ago

Having same issue here. No solution yet?

janik6n commented 4 months ago

The time window between now and Node.js 16 deprecation & summer holidays is shortening fast. We are losing hope for this and similar issues like https://github.com/serverless/serverless/issues/12133 to be resolved in reasonable time, with time still left for testing etc.

Further, as described on the other issue linked, the support is going to be on v4 only, which means that all existing stacks would need to be migrated from Serverless Framework v3 to v4. Since this is going to be a major version upgrade, many issues are expected to arise.

Since this is going to involve migration work in any case, and Serverless Framework (OSS version at least) development seems to have stagnated in November 2023, we are losing faith in this as a viable product. Thus, we have started the migration to other solutions altogether. Godspeed. 🚀

Sunac commented 3 months ago

The time window between now and Node.js 16 deprecation & summer holidays is shortening fast. We are losing hope for this and similar issues like #12133 to be resolved in reasonable time, with time still left for testing etc.

Further, as described on the other issue linked, the support is going to be on v4 only, which means that all existing stacks would need to be migrated from Serverless Framework v3 to v4. Since this is going to be a major version upgrade, many issues are expected to arise.

Since this is going to involve migration work in any case, and Serverless Framework (OSS version at least) development seems to have stagnated in November 2023, we are losing faith in this as a viable product. Thus, we have started the migration to other solutions altogether. Godspeed. 🚀

I resolved it like this - moved lambdas to node20 and simply override customS3 one via Resources. Check this if you find it useful: https://github.com/serverless/serverless/issues/11337#issuecomment-1966550809