This is an Apache Maven Archetype to create a lambda function template using AWS Java SDK 2.x. The generated template has the optimized configurations and follows the best practices to reduce start up time. Please check out AWS Dev Guide for more information.
You can use mvn archetype:generate to generate a project using this archetype. See maven archetype usage guidance for more information.
Note that you need to replace ${version} with the latest SDK version found in README.md.
- Interactive mode
mvn archetype:generate \
-DarchetypeGroupId=software.amazon.awssdk \
-DarchetypeArtifactId=archetype-lambda \
-DarchetypeVersion=${version}
- Batch mode
mvn archetype:generate \
-DarchetypeGroupId=software.amazon.awssdk \
-DarchetypeArtifactId=archetype-lambda \
-DarchetypeVersion=${version} \
-DgroupId=com.test \
-DartifactId=sample-project \
-Dservice=s3 \
-DinteractiveMode=false
| Parameter Name | Default Value | Description |
|---|---|---|
service (required) |
n/a | Specifies the service client to be used in the lambda function, eg: s3, dynamodb. You can find available services here. |
groupId(required) |
n/a | Specifies the group ID of the project |
artifactId(required) |
n/a | Specifies the artifact ID of the project |
region |
n/a | Specifies the region to be set for the SDK client in the application |
httpClient |
aws-crt-client | Specifies the http client to be used by the SDK client. Available options are url-connection-client (sync), apache-client (sync), netty-nio-client (async) and aws-crt-client(async). See http clients |
handlerClassName |
"App" |
Specifies the class name of the handler, which will be used as the lambda function name. It should be camel case. |
javaSdkVersion |
Same version as the archetype version | Specifies the version of the AWS Java SDK 2.x to be used |
version |
1.0-SNAPSHOT | Specifies the version of the project |
package |
${groupId} | Specifies the package name for the classes |
To deploy the lambda function, you can use SAM CLI. 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.
sam deploy --guided
Please refer to deploying lambda apps for more info.