Skip to content

update aws lambda java libs to aws sdk java v2 #74

Closed

Description

@SeekerWing

update aws lambda java libs to aws sdk java v2 (https://github.com/aws/aws-sdk-java-v2)

Activity

  1. cherrydev commented on May 10, 2019

    @cherrydev

    I think I understand what you're meaning, but I don't think this is what you're really looking for. First, an example of what I see as problematic:
    If you want to handle an S3 event (using aws-lambda-java-events) and communicate with S3 via aws-sdk-java-v2 you're forced to include aws-sdk-java-s3 (v1) and (therefore) aws-sdk-java-core (v1) which adds 2MB to your package.
    The reason why the problem is not solved by creating a dependency on aws-sdk-java-v2 (instead of v1) is because v2 does not actually include the event definitions for S3 events, as far as I can find.
    I believe the correct solution is to mirror the event classes that are defined in v1 of the sdk that are used by aws-lambda-java-events into a different package and either include them directly in aws-lambda-java-events (just like most of the event types) or break them out into a separate package. This would allow you to simply remove the dependency on sdk-v1 without introducing a new dependency on v2. This should be really easy since the event classes seem extremely self-contained. For example, the S3 events are S3EventNotification.class, a number of static inner classes, a single call to SdkHttpUtils.urlDecode(from sdk core v1) and the use of DateTimeJsonSerializer (also from sdk core v1) which is a one-liner class.

    I might recommend this issue be renamed to something like "Remove aws-sdk-java-v1 dependencies from aws-lambda-java-events".

  2. mouse256 commented on Sep 27, 2019

    @mouse256

    Any progress on this? It's rather annoying/confusing.

  3. WilliamNoad commented on Oct 14, 2019

    @WilliamNoad

    Any movement, or plans you can let us in on? This is a blocker for my employers on a clean migration to the V2 SDK, which has some very welcome improvements.

  4. MohammedAlSafwanOld commented on Feb 13, 2020

    @MohammedAlSafwanOld

    Any news about this ?

  5. arjunpunnam commented on Mar 1, 2020

    @arjunpunnam

    @cherrydev exactly echoes our thoughts,its redundant and confusing to have both v1 and v2 dependencies and we cannot completely move away from V1(which AWS strongly suggests).Another unrelated issue is where the V2 S3 api doesn't support generatePresignedUrlgeneration which is a blocker for us.

  6. geniusit commented on Mar 7, 2020

    @geniusit

    @cherrydev indeed, it's not a bad idea to copy the classes related to events in another package in order to get away from the v1.
    However the S3Event class has to be rewrite because it is the child class of S3EventNotification.
    It implies to change the signature of the handleRequest method with the new S3Event class. I tried to do it but it that situation the records are empty. So how the records are populated ? Is there a way to override it ?

  7. added a commit that references this issue on May 12, 2020
  8. carlzogh commented on May 18, 2020

    @carlzogh
    Contributor

    Hey all, thanks for your patience - aws-lambda-java-events version 3.0.0 was just released with support for all events (including S3) without the inclusion of SDK v1 dependencies.
    This should help you make use of the AWS SDK for Java v2 and reduce your function package size as the v1 SDK does not need to be bundled anymore if it's not explicitly needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions