Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SeekerWing opened this issue Feb 1, 2019 · 7 comments
Closed

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

SeekerWing opened this issue Feb 1, 2019 · 7 comments

Comments

@SeekerWing
Copy link

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

@cherrydev
Copy link

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".

@mouse256
Copy link

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

@WilliamNoad
Copy link

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.

@MohammedAlSafwanOld
Copy link

MohammedAlSafwanOld commented Feb 13, 2020

Any news about this ?

@arjunpunnam
Copy link

arjunpunnam commented Mar 1, 2020

@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.

@geniusit
Copy link

geniusit commented Mar 7, 2020

@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 ?

carlzogh added a commit to carlzogh/aws-lambda-java-libs that referenced this issue May 12, 2020
@carlzogh
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants