Giter VIP home page Giter VIP logo

lambda-rollup's Introduction

Lambda rollup example

Simple lambda based on express, typescript and bundled with rollup.

CircleCI

Prerequisities

Development

Install

Simply by nvm use && npm install.

Run

Run on local by npm start.

Deployment

Initial

Create role

Before executing blindly, just think of to what function has to have access, current one has access to everything.

After you're done with selecting just run aws iam create-role --role-name lambda_rollup_role --assume-role-policy-document file://aws/function_role.json and make sure to copy the output ARN of role

Build the application

For initial build run: rollup -c rollup.config.json.

Prepare zip

To pack everything to one zip file run cd dist && zip -rq ./lambda.zip ../node_modules ./handler.js && cd ..

Create function

Now simply create function and upload the zip file by running:

aws lambda create-function --region eu-central-1 --function-name lambda-rollup --zip-file fileb://dist/lambda.zip --role <your_arn_from_above> --handler handler.handler --runtime nodejs8.10

Test

To test successful deployment simply run:

aws lambda invoke --function-name lambda-rollup --payload file://events/alb.json --region eu-central-1 out.txt

Feel free to change the event. Currently loadbalancer lambda event is in use.

Incremental

Just run ./deploy.sh!

What does it do?

- builds app to ./dist/handler.js
- creates zip with node_modules and handler
- uploads incremental update to aws
- invokes lambda to test if it really works

lambda-rollup's People

Contributors

jeroneemou avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.