Skip to content

AWS SDK v3 Support (v2 deprecation) #8575

Closed

Description

@throrin19

Problem Statement

Actually, @sentry/serverless package use the aws-sdk v2. It results on this warnings when testing in local with serverless-offline :

(node:49034) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy

With lambdas using the node18 runtime, the sdk available is the v3, not the v2. To be able to use the sdk in v2, it must be included in the package, which makes the size of each lambdas quite substantial.

Solution Brainstorm

Use the sdk v3. But, with that, we have the problem of compatibility between aws node runtime < node18 using the sdk v2 and aws node runtime >= node18 using the sdk v3

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Jul 18, 2023
  2. Lms24 commented on Jul 18, 2023

    @Lms24
    Member

    Hi @throrin19 thanks for writing in!

    Sounds like we can't upgrade to the v3 SDK at the moment without dropping support for Node <18 on AWS Lambda. So we can't do this without releasing a major and even then it partially goes against our philosophy of supporting old runtimes as long as possible. On the other hand, I get that this warning is concerning. I'm going to backlog this issue and add it to the "Up for Discussion" tasks for our next major.

  3. throrin19 commented on Jul 18, 2023

    @throrin19
    Author

    Thanks for your response and I fully understand this complex problem

  4. alfaproject commented on Sep 6, 2023

    @alfaproject

    You don't need node 18. We are using the new SDK with node 16 and I'm pretty sure it works in node 14 and possibly even earlier versions. There's nothing special about their code

    P.S.: anyone that is using the old SDK is already receiving this:

    (node:28720) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
    Please migrate your code to use AWS SDK for JavaScript (v3).
    For more information, check the migration guide at https://a.co/7PzMCcy

  5. 58 remaining items

  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Dec 11, 2023
  7. throrin19 commented on Dec 14, 2023

    @throrin19
    Author

    I created a project with the example here : https://github.com/Aquassay/test-sentry-serverless-aws-sdk

    You can run analyze of a lambda with or without sentry to saw the difference. And the difference is like I said : with Sentry, we have an import of aws-sdk V2 by this code line :

    const awsModule = require('aws-sdk/global') as typeof AWS;

    This is the analyze without Sentry on the lambda (In my example, in TS with middy) :

    image

    And the analyze with Sentry :

    image

  8. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Dec 14, 2023
  9. lforst commented on Dec 14, 2023

    @lforst
    Contributor

    @throrin19 In your esbuild config you neither marked @sentry/serverless nor aws-sdk as external which is gonna pull everything into your bundle. This is not something we can prevent from within the SDK. This is addressed by configuring your application properly.

  10. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Dec 14, 2023
  11. throrin19 commented on Dec 14, 2023

    @throrin19
    Author
  12. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Dec 14, 2023
  13. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Dec 14, 2023
  14. AbhiPrasad commented on Apr 22, 2024

    @AbhiPrasad
    Contributor

    Will be released with 8.0.0.

  15. added this to the 8.0.0 milestone on Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions