For the Java SDK V1, I have a lambda function like this:
public static void doSomethingLambda(S3Event s3Event) throws Exception {
s3Event....
但是在SDK v2中,S3Event
似乎不存在。除非我使用了错误的依赖项? (V2 的文档非常稀疏)
这是我的 SDK V1 依赖项:
<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>
和 SDK V2:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>lambda</artifactId>
</dependency>
根据5月18日的决议aws lambda java libs 到 aws sdk java v2 https://github.com/aws/aws-lambda-java-libs/issues/74
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.
源代码是here https://github.com/aws/aws-lambda-java-libs
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)