All Projects → mariamrf → py-lambda-action

mariamrf / py-lambda-action

Licence: MIT license
A Github Action to deploy AWS Lambda functions written in Python with their dependencies in a separate layer.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to py-lambda-action

lambda-layer-tool
Build and publish AWS Lambda layers defined in YAML
Stars: ✭ 22 (-55.1%)
Mutual labels:  lambda, lambda-layer
serverless-actions
Serverless GitHub Actions
Stars: ✭ 112 (+128.57%)
Mutual labels:  lambda, actions
Bref
Serverless PHP on AWS Lambda
Stars: ✭ 2,382 (+4761.22%)
Mutual labels:  lambda, lambda-layer
lastkeypair
A serverless SSH certificate authority to control access to machines using IAM and Lambda
Stars: ✭ 39 (-20.41%)
Mutual labels:  lambda
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-75.51%)
Mutual labels:  actions
serverless-plugin-epsagon
Epsagon's plugin for Serverless Framework ⚡️
Stars: ✭ 53 (+8.16%)
Mutual labels:  lambda
java-functional-features-tutorial
This repo is DEPRECATED. Please use https://github.com/bobocode-projects/java-fundamentals-course
Stars: ✭ 15 (-69.39%)
Mutual labels:  lambda
inboard
🚢 Docker images and utilities to power your Python APIs and help you ship faster. With support for Uvicorn, Gunicorn, Starlette, and FastAPI.
Stars: ✭ 106 (+116.33%)
Mutual labels:  actions
ebs-backup
Backup EBS Volumes
Stars: ✭ 34 (-30.61%)
Mutual labels:  lambda
aws-lambda-powertools-typescript
A suite of utilities for AWS Lambda Functions that makes structured logging, creating custom metrics asynchronously and tracing with AWS X-Ray easier
Stars: ✭ 817 (+1567.35%)
Mutual labels:  lambda
gh-actions
A Github action for generating Terraform module documentation using terraform-docs and gomplate
Stars: ✭ 56 (+14.29%)
Mutual labels:  actions
nrwl-nx-action
A GitHub Action to wrap Nrwl Nx commands in your workflows.
Stars: ✭ 163 (+232.65%)
Mutual labels:  actions
code-owner-self-merge
A GitHub Action for letting CODEOWNERS merge PRs via green PR reviews
Stars: ✭ 43 (-12.24%)
Mutual labels:  actions
basic-serverless-api
A basic full stack example of building an API with AWS Amplify, Amazon API Gateway, AWS Lambda, and Amazon DynamoDB
Stars: ✭ 45 (-8.16%)
Mutual labels:  lambda
serverless-email-scheduler
Schedule future emails with AWS Lambda and Step Functions
Stars: ✭ 29 (-40.82%)
Mutual labels:  lambda
ghaction-chocolatey
GitHub Action for Chocolatey, the package manager for Windows
Stars: ✭ 58 (+18.37%)
Mutual labels:  actions
lambda
lambda calculus interpreter
Stars: ✭ 23 (-53.06%)
Mutual labels:  lambda
algoliasearch-crawler-github-actions
Algolia Crawler Github action
Stars: ✭ 24 (-51.02%)
Mutual labels:  actions
terraform-external-module-artifact
Terraform module to fetch any kind of artifacts using curl (binary and text okay)
Stars: ✭ 13 (-73.47%)
Mutual labels:  lambda
gozeit
GoZeit
Stars: ✭ 19 (-61.22%)
Mutual labels:  lambda

py-lambda-action

GitHubActions

A Github Action to deploy AWS Lambda functions written in Python with their dependencies in a separate layer. For now, only works with Python 3.6. PRs welcome.

Use

Deploys everything in the repo as code to the Lambda function, and installs/zips/deploys the dependencies as a separate layer the function can then immediately use.

Pre-requisites

In order for the Action to have access to the code, you must use the actions/checkout@master job before it. See the example below.

Structure

  • Lambda code should be structured normally/as Lambda would expect it.
  • Dependencies must be stored in a requirements.txt or a similar file (provide the filename explicitly if that's the case).

Environment variables

Stored as secrets or env vars, doesn't matter. But also please don't put your AWS keys outside Secrets.

  • AWS Credentials
    That includes the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, etc. It's used by awscli, so the docs for that can be found here.

Inputs

  • lambda_layer_arn
    The ARN for the Lambda layer the dependencies should be pushed to without the version (every push is a new version).
  • lambda_function_name
    The Lambda function name. From the AWS docs, it can be any of the following:
    • Function name - my-function
    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function
    • Partial ARN - 123456789012:function:my-function
  • requirements_txt The name/path for the requirements.txt file. Defaults to requirements.txt.

Example workflow

name: deploy-py-lambda
on:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@master
    - name: Deploy code to Lambda
      uses: mariamrf/[email protected]
      with:
        lambda_layer_arn: 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer'
        lambda_function_name: 'my-function'
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_DEFAULT_REGION: 'us-east-2'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].