Giter Club home page Giter Club logo

hello-lambda's Introduction

hello-lambda

Minimal project to get up and running on AWS lambda with Python 3.6 and pipenv.

Quickstart

The main commands are wrapped using a very simple Makefile. I believe it doesn't work on Windows but I don't have a window machine to care enough. If you feel like adding that, feel free to send me a pull request.

Install

The first time only:

  • make install: Create a virtual environment and install dependencies using pipenv

Test locally

  • make run: call the lambda handler using pipenv run

Build

  • make build: Collect dependencies and entry point script into a deployment package By default, it'll be a deliverable.zip in the root of the project.

    The target is customisable and may be provided on the command line:

    make build OUT_FILE=outfile.zip
    

Upload and Deploy

  • Go to your AWS account, in the "Lambda" section
  • Click "Create a function" > "Author from scratch" > Configure triggers page: Click "Next"
  • Give a name & description, choose Python 3.6 runtime
  • Select "Upload a ZIP file" and choose the delivrable in the file picker
  • Set the Handler to hello_lambda.lambda_handler (or more generally <script_name>.<function_name>)
  • Select/create an AWS Role, click "Next"
  • Review all the details and confirm creation
  • Run it!

Next steps

  • Add any third party package you might need using pipenv install ...
  • To deploy, run the build script and re-upload the ZIP file
  • Settings can be added as environment variables in AWS
  • Triggers can be configured to run your function: API gateway, Alexa, Cloudwatch, SNS, ...

hello-lambda's People

Contributors

browniebroke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.