A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM definition and appropriate file structure.
npm install function-stencil -gfunction-stencil init? What runtime do you need? (Use arrow keys)
❯ nodejs16.x
nodejs14.x
python3.9
java11
dotnet6Whats the function name? MyFunctionName? Choose one of the following templating languages for this runtime (Use arrow keys)
❯ sam
terraform MyFunctionName
┗ function
┃ ┣ events
┃ ┃ ┗ event.json
┃ ┣ app.js
┃ ┣ env.json
┃ ┣ harness.js
┃ ┗ package.json MyFunctionName:
Type: AWS::Serverless::Function
Properties:
CodeUri: MyFunctionName/function/
Handler: app.lambdaHandler
Runtime: nodejs14.x
Timeout: 3 Test your function locally by running harness.js from the function directory:
> node harness.js
{ statusCode: 200, body: '{"message":"hello world"}' }
localTest: 7.998ms👤 Benjamin Smith
- Website: https://github.com/bls20AWS/function-stencil
- Twitter: @benjamin_l_S
- Github: @bls20AWS
Give a ⭐️ if this project helped you!