Skip to main content

Run your local python AWS Lambda locally and deploy to S3.

Project description

Easily test and deploy your AWS Lambda function.

Requirements

  • Python 2.7.x

  • pip

  • AWS CLI

  • AWS Account (For deploying)

Since AWS currently only supports Python 2.7, you must ensure your function is tested and working in Python 2.7 before deploying.

Installation

Installation should be done using pip: pip install pylambda

Once installed, make sure you setup the AWS CLI by following: http://docs.aws.amazon.com/cli/latest/userguide/installing.html

Getting Started

Once installed you can run pylambda from the console.

Run pylambda -h to see help options.

Running Your Lambda

To run your lambda function, use the following command:

pylambda run my_lambda_function.py -e event.json -n handler

Arguments:

  • file : the name of the python file that contains the lambda function. REQUIRED

  • -e, –event : the json file that contains the event data. Must be a parsable json file. OPTIONAL

  • -n, –name : the name of the function that should be called by lambda. Default ‘handler’. OPTIONAL

Deploying to S3

To deploy your code as a zip to S3 navigate to the folder where your lambda function is contained and run:

pylambda deploy my_lambda_directory_path s3://mybucket -n my_lambda_function

  • my_lambda_directory_path = The path to the directory that contains your lambda function and requirements.txt file.

  • s3://mybucket = The location of your S3 bucket. This should follow the AWS CLI for S3 locations.

  • my_lambda_function = The name of the zip file.

NOTE: you must have a proper requirements.txt within the same folder as your lambda function if you are using external libraries installed with pip. The deploy functionality will automatically bundle in these dependencies before uploading.

Arguments:

  • directory : the directory path that contains your lambda.

  • s3_bucket : the location of your S3 bucket. Must follow the AWS CLI format. REQUIRED

  • -n, –name : the name of the zip file that will be uploaded to S3.

Project details


Download files

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

Source Distributions

pylambda-0.2.1.zip (11.5 kB view details)

Uploaded Source

pylambda-0.2.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distributions

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

pylambda-0.2.1.win32.exe (244.3 kB view details)

Uploaded Source

pylambda-0.2.1-py2-none-any.whl (19.0 kB view details)

Uploaded Python 2

File details

Details for the file pylambda-0.2.1.zip.

File metadata

  • Download URL: pylambda-0.2.1.zip
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylambda-0.2.1.zip
Algorithm Hash digest
SHA256 6d83a67adc8944c5d005efc1d3f0f9fc6cb4f1e67c6c9ffb2de5a0a26bdc271b
MD5 194889b03fc2d9f17b712e24aa7c196d
BLAKE2b-256 6cdd478563e6bb8ac942eeea12b0582657ab51ff74dcbac7bf2a6872f9e349a1

See more details on using hashes here.

File details

Details for the file pylambda-0.2.1.tar.gz.

File metadata

  • Download URL: pylambda-0.2.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylambda-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a9abd1113cb83a8267b115127c57bd3904843a71f4a121ad5be660af8d6157c5
MD5 ece8b1abcda1a9da58426508b8ca00ea
BLAKE2b-256 ce2de5d377c7f65d529bc2b9bc3f0584c484104668ba9610e7ee76e985eb7142

See more details on using hashes here.

File details

Details for the file pylambda-0.2.1.win32.exe.

File metadata

  • Download URL: pylambda-0.2.1.win32.exe
  • Upload date:
  • Size: 244.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylambda-0.2.1.win32.exe
Algorithm Hash digest
SHA256 e9aeb03c653c536f35b64e934375d69caf60153d52523c821ab9eb37e1266483
MD5 1da670c6803cf0189d3e057c8a0f23b7
BLAKE2b-256 7ead48d2d06e7571e7345400f841a5bcef506410df32f3f80838d7d878d114fb

See more details on using hashes here.

File details

Details for the file pylambda-0.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for pylambda-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 9d5b605f4fb73e4bdfcbec7994db57d5e4c68327144f36214976cc9f941ca86c
MD5 e0213dbfcb60dd3c4a7e945a27b59e49
BLAKE2b-256 4e5b8902ce54b4a2e8c7270f0b9d97e02e80c124d745ffb34f56ade88cb021e8

See more details on using hashes here.

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