A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Overview

Welcome to function-stencil 👋

A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM definition and appropriate file structure.

Install

npm install function-stencil

Usage

function-stencil init

1. Choose the function runtime

? What runtime do you need? (Use arrow keys)
❯ nodejs16.x 
  nodejs14.x 
  python3.9 
  java11
  dotnet6

2. Provide a function name

Whats the function name? MyFunctionName

3. Choose a templating language snippet

? Choose one of the following templating languages for this runtime (Use arrow keys)
❯ sam 
  terraform 

4. Function code and file system is generated

MyFunctionName
 ┗ function
 ┃ ┣ events
 ┃ ┃ ┗ event.json
 ┃ ┣ app.js
 ┃ ┣ env.json
 ┃ ┣ harness.js
 ┃ ┗ package.json

4. AWS SAM snippet is generated, drop this into the resource block of your SAM template.yaml

  MyFunctionName:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: MyFunctionName/function/
      Handler: app.lambdaHandler
      Runtime: nodejs14.x
      Timeout: 3 

Testing

Test your function locally by running harness.js from the function directory:

> node harness.js
{ statusCode: 200, body: '{"message":"hello world"}' }
localTest: 7.998ms

Contributing

Start here

Author

👤 Benjamin Smith

Show your support

Give a ⭐️ if this project helped you!

You might also like...

Learn Web 2.0 and Web 3.0 Development using Next.js, Typescript, AWS CDK, AWS Serverless, Ethereum and AWS Aurora Serverless

Learn Web 2.0 Cloud and Web 3.0 Development in Baby Steps In this course repo we will learn Web 2.0 cloud development using the latest state of the ar

Jan 3, 2023

Solidity Quickstart is an extensive solidity guide for the solidity newbies out there.

🚀 Solidity Quickstart Solidity Quickstart is an extensive solidity guide for the solidity newbies out there. 🤔 How does it work? All the guides rela

Aug 6, 2022

Competidaily Generator lambda function to retrieve a random theme from our database.

Competidaily Generator backend - GET RANDOM THEME This repo contains the GET requisition used as a lambda function to retrieve a random theme from the

Dec 17, 2022

A crawler that crawls the site's internal links, fetching information of interest to any SEO specialist to perform appropriate analysis on the site.

Overview 📝 It is a module that crawls sites and extracts basic information on any web page of interest to site owners in general, and SEO specialists

Apr 22, 2022

A crawler that crawls the site's internal links, fetching information of interest to any SEO specialist to perform appropriate analysis on the site.

Overview 📝 It is a module that crawls sites and extracts basic information on any web page of interest to site owners in general, and SEO specialists

Apr 22, 2022

Alexa Skill & Google Action code that works on AWS Lambda

Alexa Skill & Google Action code that works on AWS Lambda

Jovo v4 Sample: Alexa Skill & Google Action on AWS Lambda Website - Docs - Marketplace - Template This Jovo v4 sample app showcases the following feat

Nov 22, 2022

A sample code that implements a simple Web app using AWS CDK v2

A sample code that implements a simple Web app using AWS CDK v2

A sample code that implements a simple Web app using AWS CDK v2. This code will be introduced in a live coding session at AWS Summit Online Japan 2022 Developer Zone in 2022/5/25.

Dec 5, 2022

AWS Lambda and API Gateway, simplified for Javascript

AWS Lambda and API Gateway, simplified for Javascript

alanajs AWS Lambda and API Gateway, simplified for JavaScript About alanajs Make setting up Lambda microservices easier than ever. alanajs is a free,

Aug 1, 2022

🚀 Using top-level await in AWS Lambda with TypeScript, esbuild and Serverless Framework

🚀 Using top-level await in AWS Lambda with TypeScript, esbuild and Serverless Framework

🚀 Top-level await in AWS Lamba with TypeScript Articles https://dev.to/oieduardorabelo/top-level-await-in-aws-lamba-with-typescript-1bf0 https://medi

Nov 23, 2022
Comments
  • Spelling error in About

    Spelling error in About

    Definition is misspelled.

    A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure

    opened by lbrent2k 1
  • add cdk typescript template

    add cdk typescript template

    • create cdk typescript template
    • update command/init.ts to point to template.ts file
    • created a cdk-typescript folder to allow automatic folder detection. Another option would be to have cdk folder and a subfolder typescript but in this case the wizard needs to be modified to read the content of cdk folder. It's up to you how you want to keep it.
    opened by cornelcroi 0
Owner
Ben Smith
Serverless Developer Advocate @AWS. Questions about serverless? Tweet me @benjamin_l_s. // Code provided without warranty.
Ben Smith
MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are still part of a flow in the AWS cloud remote.

MerLoc MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are

Thundra 165 Dec 21, 2022
AWS Lambda & Serverless - Developer Guide with Hands-on Labs. Develop thousands line of aws lambda functions interact to aws serverless services with real-world hands-on labs

AWS Lambda & Serverless - Developer Guide with Hands-on Labs UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository -> https://www

awsrun 35 Dec 17, 2022
Under the Sea is an official AWS workshop delivered by AWS SAs and AWS Partners to help customers and partners to learn about AIOps with serverless architectures on AWS.

Under the Sea - AIOps with Serverless Workshop Under the Sea is an exciting MMORPG developed by the famous entrepreneur behind Wild Rydes, the most po

AWS Samples 4 Nov 16, 2022
Sample code for resizing Images with Lambda@Edge using the Custom Origin. You can deploy using AWS CDK.

Resizing Images with Lambda@Edge using the Custom Origin You can resize the images and convert the image format by query parameters. This Lambda@Edge

AWS Samples 16 Dec 11, 2022
AWS SAM project that adds the snippets from serverlessland.com/snippets as saved queries in CloudWatch Logs Insights

cw-logs-insights-snippets Serverlessland.com/snippets hosts a growing number of community provided snippets. Many of these are useful CloudWatch Logs

Lars Jacobsson 12 Nov 8, 2022
A serverless AWS expense tracker API. AWS Lambda functions, API gateway, and Dynamodb are among the ingredients.

AWS-Serverless-API A serverless AWS expense tracker API. AWS Lambda functions API gateway Dynamodb Endpoints Create a new expense: Method: POST Body f

Ondiek Elijah Ochieng 1 Jul 16, 2022
A monorepo that uses the AWS Cloud Development Kit to deploy and configure nanomdm on AWS lambda.

NanoMDM on AWS This repo builds and configures a nanomdm server to run on AWS lambda. It uses the Cloud Development Kit and tries to follow best pract

Stevie Clifton 4 May 26, 2022
Lumos is an AWS Lambda visualizer and open source alternative to AWS CloudWatch.

Lumos Lambda Metrics Visualizer Table of Contents About Lumos Techologies Used Getting Started Key Lambda Metrics How to Contribute License Contributo

OSLabs Beta 36 Nov 5, 2022
Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region

Run Any Node.js Version in AWS Lambda Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region. We add support f

Fusebit 116 Dec 15, 2022