AWS Java SDK Version For Creating a Lambda

匆匆过客 提交于 2019-12-01 23:14:19

However I am trying to use the latest SDK as recommended here but this is completely different and the RequestHandler interface doesn't appear to exist anymore.

You're using wrong a dependency. This is an SDK for using AWS Services via its REST API, like:

  • Putting an object to S3
  • Listing EC2 instances
  • Deleting an item from AWS DynamoDB
  • Invoking a Lambda

I.e. this is an SDK for working with various AWS services. It consists of many libraries, like aws-java-sdk-s3, aws-java-sdk-dynamodb. aws-java-sdk-lambda is one of themm, but it is for interacting with Lambda API and not for authoring Lambdas.

The libraries you need for authoring Lambdas are:

As you see, those are different. First provides Handler interfaces you're looking for and second contains various events Lambda can accept as input: SNS events, CloudWatch timers and so on.

From here:

Lambda supports two approaches for creating a handler:

  • Loading the handler method directly without having to implement an interface. This section describes this approach.

  • Implementing standard interfaces provided as part of aws-lambda-java-core library (interface approach). For more information, see Leveraging Predefined Interfaces for Creating Handler (Java).

Here is aws-lambda-java-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!