Skip to main content

An AWS Lambda packager

Project description

Lambda lift

Lambda Lift, is a streamlined building and deployment tool designed for developers and teams managing multiple Python-based AWS Lambda functions. Lambda Lift simplifies the packaging and deployment process, making it easier for you to focus on building and improving your applications.

Key Features

  • Designed to support multiple Lambda functions in a single repository
  • Utilize TOML files for easy and clear configuration of each deployed Lambda function
  • Supports deployment profiles (e.g., deployment to dev/staging/prod)

Limitations

  • Works with Python-based Lambdas only
  • Requires Python 3.10 or above
  • Requires a Lambda to exist at the time of deployment; this tool doesn't create Lambda functions

Getting started

Install the tool via PIP

pip install lambda-lift

Then use it from the command line

lambda-lift  # Build all lambdas
lambda-lift my-awesome-lambda my-another-lambda  # Build only lambda functions specified
lambda-lift my-awseome-lambda --deploy staging  # Deploy the lambda using the staging profile
lambda-lift --deploy-all prod  # Deploy all lambdas using the prod profile

Configuration

The configuration is done via TOML files. The files must be named either as lambda-lift.toml, or lambda-lift-<name>.toml (<name> could be anything). The configuration files can be placed anywhere in the repository - for example, all toml files in one location, or each toml file in the directory of the lambda it configures.

Toml example

[general]

# A name of your lambda to be used for selective building
# If not specified, the <name> part of the toml file name will be used
# If not specified and the toml file name doesn't have the <name> part, then the directory 
# name of the toml file will be used
name = "my-lambda"


[build]
# List all source paths that need to be included relative to the toml file
source_paths = ["src", "../common/src"]

# Path to the requirements file relative to the toml file. 
# If not specified, no requirements will be installed
requirements_path = "requirements.txt"

# Location of the resulting zip file relative to the toml file; must be specified
# git_root and name templates are available for all paths within the toml file
destination_path = "{git_root}/dist/{name}.zip"

# Location of the cache folder relative to the toml file; must be sprcified
# Cache folder speeds up updating lambdas by reusing the dependencies that haven't changed
cache_path = "deploy/prod/cache"

# The platform for which the lambda will be built. Must be either arm64 or x86, and must be specified.
platform = "arm64"

# The python executable to be used for fetching the dependencies. This parameter allows using 
# different python versions for different lambdas. If not specified, the same python executable
# that is used to run the lambda-lift will be used.
python_executable = "python3.12"

# The libraries which shouldn't be added to the resulting ZIP file
# Generally, these should be the libraries that are provided by AWS Lambda
# You can find a list of these libraries here: https://gist.github.com/gene1wood/4a052f39490fae00e0c3
# (check comments at the link)
ignore_libraries = [
    "awslambdaric",
    "boto3",
    "botocore",
    "jmespath",
    "pip",
    "python-dateutil",
    "s3transfer",
    "setuptools",
    "simplejson",
    "six",
    "urllib3",
    "numpy",
]

# Each deployment profile is a separate section in the toml file
# The name of the section is the name of the deployment profile
# The deployemnt profile is specified by the user when deploying the lambda
# For example: `lambda-lift my-lambda --deploy prod`

[deployment.prod]

# The AWS region where the lambda will be deployed. Must be specified.
region = "us-west-1"

# The name of the lambda in AWS. It must exist at the time of deployment.
# If it is not, first create it by using AWS console, AWS CLI, or a different tool
# such as Pulimi or Terraform.
name = "my-lambda-prod" 

# The name of the AWS profile to be used for deployment (optional)
aws_profile = "my-profile"

[deployment.staging]
region = "us-west-1"
name = "my-lambda-staging"
aws_profile = "my-profile"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambda_lift-0.0.12.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

lambda_lift-0.0.12-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file lambda_lift-0.0.12.tar.gz.

File metadata

  • Download URL: lambda_lift-0.0.12.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for lambda_lift-0.0.12.tar.gz
Algorithm Hash digest
SHA256 6785dae5e0ec286b6cecc1fdb554a8f01dd63817d20e52ea291cde3b608f4bf8
MD5 0561cdb3a568c6b8c721480e4478fd89
BLAKE2b-256 6fe87dbab63de39b17805914fc0aa925b30dcc077a5ceeb261e60f137069fe47

See more details on using hashes here.

File details

Details for the file lambda_lift-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: lambda_lift-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for lambda_lift-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 aeaf1417f55669aa57a8d300aa99074ca4737e2f316078fff82573e31a240ebd
MD5 66d25afc677f68df975bb2b6ec329931
BLAKE2b-256 28d293a0d7298b758c4977e82ddd365b3e11c817db6969f12e448d202f6d01ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page