Skip to content

andrei-punko/aws-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2f9f759 · Nov 27, 2024

History

20 Commits
Sep 3, 2024
Apr 25, 2022
Apr 22, 2022
Apr 22, 2022
Nov 27, 2024
Sep 3, 2024

Repository files navigation

AWS Lambda usage example

Java CI with Maven Coverage Branches

Based on this article https://www.baeldung.com/java-aws-lambda

Prerequisites

  • Maven 3
  • JDK 21

How to build

mvn clean install

How to run on AWS

Create Lambda functions:

  • MethodHandlerLambda
  • RequestHandlerLambda
  • StreamHandlerLambda
  • SavePersonHandlerLambda

Upload result fat JAR from ./target folder into each Lambda function

Set appropriate handler in Runtime settings section (on Code tab) of each Lambda function:

  • by.andd3dfx.lambda.LambdaMethodHandler::handleRequest
  • by.andd3dfx.lambda.LambdaRequestHandler::handleRequest
  • by.andd3dfx.lambda.LambdaRequestStreamHandler::handleRequest
  • by.andd3dfx.lambda.LambdaSavePersonHandler::handleRequest

Create DynamoDB Table Person with Partition key id

Created DynamoDB table should be in the same region that declared in LambdaSavePersonHandler.REGION

How to check

From Test tab - send test event with some text in quotes

Green section "Execution result: succeeded" should appear. Check logs in it

About

Experiments with AWS Lambda

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages