This project contains an AWS Lambda maven application with AWS Java SDK 2.x dependencies.
- Java 1.8+
- Apache Maven
- AWS SAM CLI
- Docker
The generated function handler class just returns the input. The configured AWS Java SDK client is created in DependencyFactory
class and you can
add the code to interact with the SDK client based on your use case.
mvn clean install
sam local invoke
To add more service clients, you need to add the specific services modules in pom.xml
and create the clients in DependencyFactory
following the same
pattern as s3Client.
The generated project contains a default SAM template file template.yaml
where you can
configure different properties of your lambda function such as memory size and timeout. You might also need to add specific policies to the lambda function
so that it can access other AWS resources.
To deploy the application, you can run the following command:
sam deploy --guided
See Deploying Serverless Applications for more info.