This project contains an AWS Lambda maven application with AWS Java SDK 2.x dependencies. This is generated using AWS archetype.
- Java 11
- Gradle / 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.
gradle clean build
# or
mvn clean package
sam local invoke
# or
sam local invoke -t template-maven.yaml
To add more service clients, you need to add the specific services modules in build.gradle
or 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.