Skip to main content

Simplify your lambda workflow

Project description

simple-lambda

simple-lambda is a script that wraps around uv to publish simple scripts to AWS Lambda.

The core idea surrounds PEP-723 inline metadata scripts which uv has great support for.

Prerequisites

  • uv: the intention is to use the install UV.
  • aws cli configured.

Installation

Optional installation as a tool.

uv tool install simple-lambda

Use uvx simple-lambda if you don't want to install it as a tool.

Usage

Deploying a package

 Usage: simple-lambda deploy [OPTIONS] FUNCTION_NAME FILE_PATH                                                         
                                                                                                                       
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    function_name      TEXT  [required]                                                                            │
│ *    file_path          FILE  Path to the main Python file containing the Lambda function handler. [required]       │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                         │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Define the lambda function first via the UI or using something like terraform.

Create a script locally:

touch my_code.py

Add dependencies using UV:

uv add --script my_code.py requests

Optionally lock dependencies using UV:

uv lock --script my_code.py

Once you finish adding your code to the file. You can now deploy it:

uvx simple-lambda deploy lambda_function_name my_code.py

simple-lambda will automatically handle the dependencies based on the architecture and the runtime defined for the lambda function.

Build package only

If you only want to build the zip file, you can use the build command. You will however need to specify the architecture and python version.

 Usage: simple-lambda build [OPTIONS] FILE_PATH                                                                        
                                                                                                                       
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    file_path      FILE  Path to the main Python file containing the Lambda function handler. [required]           │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --architecture          [x86_64|arm64]  The target architecture of the lambda. [required]                        │
│    --output                FILE            Path to the output .zip file. [default: deployment_package.zip]          │
│    --python-version        TEXT            The Python version for the Lambda deployment package. [default: 3.13]    │
│    --help                                  Show this message and exit.                                              │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

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

simple_lambda-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_lambda-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file simple_lambda-0.1.0.tar.gz.

File metadata

  • Download URL: simple_lambda-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for simple_lambda-0.1.0.tar.gz
Algorithm Hash digest
SHA256 658e18bc8600be3db317c89773ee2db032fc695ada5345c45168ae41a86ef251
MD5 2ce5aa5b84502f59acc83cc5f6bf07f6
BLAKE2b-256 34b631aa8292c67698ce145863783c31c9662fc91bab221356c2e69e57bba8ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_lambda-0.1.0.tar.gz:

Publisher: python-publish.yml on Jamie-Chang/simple-lambda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_lambda-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simple_lambda-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for simple_lambda-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52065c5e57b95d34f9c330827f0d8cb90643d513434cb6884caa94a274360013
MD5 ceec9ca75bf9effacb77ca8bfcdd1ced
BLAKE2b-256 a6e6788fcbf75c78bd0ba7ae11ecd83a535a37ee15a8f42b699a15e5c49bde49

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_lambda-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on Jamie-Chang/simple-lambda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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