AWS Lambda development
Before we get into writing the code, we need to understand the handler method in Lambda functions. The handler method is a specialized method in Lambda function code that processes the event when the Lambda function is invoked. On invocation, the Lambda service will execute this handler method and the Lambda execution environment remains busy until this method finishes execution or errors out.
You can write Lambda functions in different supported languages, but for our example, we are going to use Java 11. In a Lambda function, any code written within the handler method gets executed each time Lambda is invoked, but class-level code is initialized once when your runtime initializes, and it may or may not be executed every time depending on the Lambda service, and whether it is using the same execution environment or creating a new one due to scaling needs or idle timeout.
AWS provides libraries to each supported language for creating handler functions and...