Hands-On Serverless Applications with Kotlin
上QQ阅读APP看书,第一时间看更新

A case study of a simple Java Lambda function

In this section, we'll look at how we can create a basic Lambda function end-to-end, using the Java programming model. The Java programming model for Lambda functions can be extended to any language that runs on JVM. In the later sections of this book, we will explore Kotlin, but for the sake of focusing on AWS Lambda basics, we'll perform this exercise in Java. This section will aim at providing a starting point for the reader for creating, configuring, deploying, and testing Lambda functions. We will apply all of the concepts that we have seen in a practical example.

We will be creating a very basic Lambda function. It will be a greeter service. The input will be a String parameter, and it will return a greeting composed by prefixing Hello to the passed parameter.

We will be using Java 8 as the programming language, Gradle as the dependency management and packaging tool, and IntelliJ Idea CE as the IDE in this exercise. A basic knowledge of these technologies is recommended. In addition, there will be screenshots for the user to follow. It is recommended that the reader sign up for an AWS account and follow the steps in a hands-on fashion.