gpt4 book ai didi

java - 什么是 Lambda S3Event 的 AWS SDK V2 类?

转载 作者:行者123 更新时间:2023-12-01 12:17:38 32 4
gpt4 key购买 nike

对于 Java SDK V1,我有一个这样的 lambda 函数:

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 to 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.
源代码是 here

关于java - 什么是 Lambda S3Event 的 AWS SDK V2 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55711049/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com