Skip to main content

lambada

Manage AWS Lambda functions using a Simiotics Function Registry

Install

pip install -U simiotics-lambada

Use

This section lets you try out lambada using our example hello function.

First, export your SIMIOTICS_FUNCTION_REGISTRY environment variable. This tells lambada which Simiotics Function Registry to work with. If you do not have a private Simiotics account, you can use our free, public, and totally open registry:

export SIMIOTICS_FUNCTION_REGISTRY=registry-alpha.simiotics.com:7011

Make sure that your AWS credentials are available either by exporting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or by ensuring that the profile you want to use is default in your AWS credentials file, or by exporting AWS_PROFILE. If you are not familiar with AWS authentication, you can read more here: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html

Decide on a key under which you would like to register the hello function into the Simiotics Function Registry. For example:

HELLO_KEY=hello-$(date -u +%s)

Register the function against the Simiotics Function Registry using lambada:

lambada register --key $HELLO_KEY \
    --code examples/hello/hello.py \
    --handler hello \
    --requirements examples/hello/requirements.txt

Check that the function was successfully registered (if the output of the following command is empty, there is a problem):

lambada list | grep "$HELLO_KEY"

Create an AWS IAM role capable of executing the hello function and logging to CloudWatch:

lambada create_role --key $HELLO_KEY --name iam-lambada-demo

Deploy the function as an AWS Lambda:

lambada deploy --key $HELLO_KEY --name lambda-lambada-demo

This should return an AWS Lambda ARN of the form:

arn:aws:lambda:<REGION>:<PROJECT ID>:function:lambda-lambada-demo

Now you can invoke the deployed Lambda using the AWS command-line interface:

OUTFILE=$(mktemp)
aws lambda invoke --function-name lambda-lambada-demo \
    --payload '{"target": "Sophia"}' \
    $OUTFILE
cat $OUTFILE
rm $OUTFILE

To take down the AWS Lambda:

lambada down --key $HELLO_KEY

This only removes the AWS Lambda. It doesn't delete the IAM role. If you would like to get rid of that, as well:

lambada down --key $HELLO_KEY --teardown

Kick back, enjoy some smooth tunes, and let the Lambdas proliferate.

Support

If you experience any problems with this tool, please add an issue on this repository.

Metadata

Release files for simiotics-lambada 0.2.0

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

Source distribution (sdist)

Source distribution for simiotics-lambada 0.2.0
File Size Uploaded
simiotics-lambada-0.2.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simiotics-lambada 0.2.0
File Interpreter ABI Platform
simiotics_lambada-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / simiotics-lambada-0.2.0.tar.gz

Download URL simiotics-lambada-0.2.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ac28b03fd0270151103fe4ae308801d3754ad89996733bb97ec2dcc062ed5830
BLAKE2b-256 checksum
How to use checksums
371439856b2af5ceb891182b2a8dbd66508aafbba21753cac582e92a0bf2ea88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

Release files / simiotics_lambada-0.2.0-py3-none-any.whl

Download URL simiotics_lambada-0.2.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cc1cb6dd373eb2f7dd1622b2953a396b7e052c9a3c7bc2e6cbb005706880527
BLAKE2b-256 checksum
How to use checksums
2c01ab17d2fccadbaad7619bfc1cb1995e858cd0ff65306300c99072a2c2d38e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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