Way*_*eio 7 java amazon-web-services maven aws-sdk aws-lambda
For the Java SDK V1, I have a lambda function like this:
public static void doSomethingLambda(S3Event s3Event) throws Exception {
s3Event....
Run Code Online (Sandbox Code Playgroud)
however in SDK V2, S3Event does not seem to exist. Unless I am using the wrong dependency? (The docs for V2 are pretty sparse)
Here is my SDK V1 Dependencies:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.534</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
and SDK V2:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>lambda</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)
根据 5 月 18 日提供的决议,将aws lambda java libs 转换为 aws sdk java v2
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.
Run Code Online (Sandbox Code Playgroud)
源代码在这里
| 归档时间: |
|
| 查看次数: |
782 次 |
| 最近记录: |