Synopsis
The is the base tech stack for all AWS Lambda tech stacks. If a new Lambda tech stack is created, deriving from this tech stack should be considered although it is not mandatory.
Note: This tech stack should be derived from and never used directly during a project generation session.
Depending on the complexity of the input model, the number of individual functions required to support CRUD functionality can quickly get into the 100s. Harbormaster simplifies this not only through generation, but also by providing a means of indicating how to segment the functions.
As part of the project options, Lambda tech stack allow for the assignment an option named
crudDeclStrategy within the
aws-lambda options set. This option specifies the strategy Harbormaster should apply when creating the CRUD serverless functions:
- methodsPerClass – indicates a unique serverless function should be created for each CRUD method on each class. This will result in a great number of serverless functions but could provide the most amount of flexibility to user’s of the API
- uberMethodPerClass – indicates a single execution entry point per class that in turn will delegate to the correct internal function. This will result in a one-to-one mapping between entities found in the model and serverless functions. This is the default setting.
- uberMethod – indicates a single execution entry point for the entire API set. In turn, this entry point determines which class and class method to delegate to. There will only be one serverless function regardless how many underlying classes and functions.
Details
Generated Project Support:
- Build:
-
- Maven
- Contains Velocity macros uses to assist in generating the conditional contents of a Maven POM file. If using a supported CI platform, the directives to build and deploy the Lambda functions are handled by the generated YAML pipeline file. Otherwise, the generated Maven POM file contains the necessary plug-ins to build and deploy.
- Java:
- Contains Velocity templates and macros for generating the Lambda functions using Java 8+
- NodeJS:
- Contains the Velocity templates and macros for generating the Lambda functions using NodeJS
Options
For additional options see
.common.tech.stack options
Option Name |
description |
Type |
values |
aws-lambda |
s3Bucket |
Name of an S3 bucket where the Lambda function bundle will be uploaded to. |
input |
|
runtime |
Version of Lambda runtime to use |
select |
default: java8
- java8
- nodejs6.10
- nodejs8.10
Note: NodeJS support is in progress |
lambdaRoleArn |
AWS Lambda Role ARN |
input |
|
timeout |
Funcion invocaion timeout in seconds |
input |
default: 30 |
memorySize |
Memory to allocate for a function invocation in MB |
input |
default: 512 |
forceUpdate |
Whether to update an already deployed function |
boolean |
default: true |
publish |
Whether to publish the set of lambda functions |
boolean |
default: true |
vpcSubnetIds |
optional list of subnet ids |
input |
|
vpcSubnetIds |
optional list of VPC subnet ids |
input |
|
vpcSecurityGroupIds |
optional list of VPC Security Group ids |
input |
|
crudDeclStrategy |
Lamba CRUD declaration strategy |
select |
default: uberMethodPerClass
- methodsPerClass
- uberMethodPerClass
- uberMethod
|
swagger |
host |
API host |
input |
|
basepath |
location of the swagger file |
input |
|
contact name |
Name of the contact |
input |
|
contact email |
Email of the contact |
input |
|
contact url |
url of the contact |
input |
|
license url |
Url to the license file |
input |
default: http://www.apache.org/licenses/LICENSE-2.0.html |
license name |
Name of the license file |
input |
default: Apache 2.0 |
title |
Swagger file title |
input |
|
version |
version of underlying Lambda functions |
input |
default: v1.0 |
description |
Description of the Swagger file |
input |
|
terms of service |
Terms of service |
input |
|
output formats |
Output formats of the Swagger file |
input |
default: json
|
Usage
If using a CI/CD platform such as CircleCI, AWS Codebuild, Jenkins, etc.., it is best to refer to the Pipeline YAML file generated for that platform.
If not using a CI/CD platform refer to the instructions below on how to use the generated project.
Manual Deployment
Use maven to install then package the application by issuing the following command:
mvn package
To deploy the package and overwrite existing functions:
mvn lambda:delete-lambda lambda:deploy-lambda -f pom-aws-lambda.xml