Skip to main content

awslambdalocal

awslambdalocal is a tool to simulate running an AWS Lambda locally, for lambda functions in Python.

Table of Contents

Requirements

  • Python => 3.8
  • Poetry => 1.1.12 or another package manager that supports direct git dependencies

Install

To install awslambdalocal, we recommend adding it to your pyproject.toml in the dev-dependencies section as shown in the example below.

pip install awslambdalocal

Obs.: We recommend using Poetry. See https://python-poetry.org/docs/

About: CLI

Positional Arguments:

Argument Description
file Specify Lambda function file name

Optional Arguments:

Argument Description
--help Show this help message and exit
-e Specify Event data file name. REQUIRED without param -w
-h Lambda function handler name. Default is "handler"
-p Read the AWS profile of the file.
-r Sets the AWS region, defaults to us-east-1.
-t Sets lambda timeout. default: 3
-w Starts lambda-local in watch mode listening to the specified port [1-65535].

CLI Examples

# Simple usage
pyhton -m awslambdalocal main.py test-event.json

# Input all arguments
pyhton -m awslambdalocal main.py test-event.json -p my_profile -r my_region -h lambda_handler -t 30

Tutorials


This session contains a collection of tutorials.

Debug Python in VSCode

To use vscode debug with awslambdalocal follow the steps below

  1. Click run and debug

  2. Click create a launch.json file

  3. Choose Python

  4. Choose Module

  5. Set the module name "awslambdalocal"

  6. After this process, VSCode will create a file called launch.json in the .vscode folder located at the root of the project

  7. Copy and paste the json below into the launch.json file, this file aims to call the awslambdalocal module and passes the necessary and optional parameters as arguments

    {
        // Use o IntelliSense para saber mais sobre os atributos possíveis.
        // Focalizar para exibir as descrições dos atributos existentes.
        // Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Lambda Local", // Debug configuration name
                "type": "python", // Type of configuration. Python, Node and etc.
                "request": "launch",
                "module": "awslambdalocal", // Module that will be called,
                "cwd": "${workspaceFolder}", // Your project's root folder
                "args": [
                    "file_python.py", // Main file that will be called by lambda
                    "your_test_event.json", //Input in json format that will be received by lambda
                    // Optional args ...
                    "-h",
                    "handler",
                    "-p",
                    "your_profile",
                    "-r",
                    "us-east-1"
                ]
            }
        ]
    }
    

Metadata

Release files for awslambdalocal 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awslambdalocal 1.0.9
File Size Uploaded Provenance Actions
awslambdalocal-1.0.9.tar.gz 8.0 kB Without provenance Details for awslambdalocal-1.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for awslambdalocal 1.0.9
File Interpreter ABI Platform Actions
awslambdalocal-1.0.9-py3-none-any.whl Python 3 none any Details for awslambdalocal-1.0.9-py3-none-any.whl

Total release size: 16.3 kB

Release files / awslambdalocal-1.0.9.tar.gz

Download URL awslambdalocal-1.0.9.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
89a46dfeab95b136080fdfad8c18716e2dffc8bb38ab092c704619c41db051f3
BLAKE2b-256 checksum
How to use checksums
8449296b0107184003e75d2bfbe6f376a9df713cad5edeb15d6e19085761c14e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Linux/5.10.16.3-microsoft-standard-WSL2

Release files / awslambdalocal-1.0.9-py3-none-any.whl

Download URL awslambdalocal-1.0.9-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
956c0a2c77ab90b816ed7b2a2729a74c4fd01c3da71d3fbbedc3b06e550986f2
BLAKE2b-256 checksum
How to use checksums
269df1dd2ed1ff4033e1f054c09ea214389b203f665d44ca075e6bbd6075fa39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Linux/5.10.16.3-microsoft-standard-WSL2

Security for awslambdalocal 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page