You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
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
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".
@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 ?
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.
arjunpunnam, andyduncanitv, h-okhs, ArkUmbra, nan-zhong, bowersj27, dskrvk, kellenschmidt-mcd, rupeshpatil761, as2d3, and monscamus reacted with thumbs up emoji
h-okhs, gustav-sundin-wcar, Angel-O, azolotko, as2d3, and konbk reacted with hooray emoji
All reactions