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

Configuring the Lambda function

Having created the function, the next steps are as follows:

Note the following about the preceding screenshot:

  • In the Designer section, we can wire up the preconfigured event sources from other AWS offerings as an upstream trigger to the function. In addition, we can configure access to downstream and allied components, like other Lambda functions, DynamoDB, and CloudWatch logs.
  • The important section is the Function code section, which allows for choosing to upload the deployment package as a .zip or .jar. It also allows us to configure the handler name in the following format:
packageName.ClassName::methodName
  • As you will see in the subsequent sections, for this exercise, we will choose the package/group name as com.example, the class as Greeter, and the method as handleRequest.

The next part of the configuration is shown in the following screenshot:

As you can see, the developer can set the environment variables, tag the Lambda function for easier lookup, supply the basic settings (like memory and limit out duration), and set the execution role.
We chose the sensible defaults for the settings, and you can see that the execution role greeter-service-executor-role is already selected.