inst/lambda/README.md

Lambda function development

Python installation

AWS CLI installation

Setup

Development

Deployment

Integration

Once the Lambda function is deployed it can be viewed and tested in the Lambda functions console https://console.aws.amazon.com/lambda. Detailed log messages and errors are available at the Cloudwatch console https://console.aws.amazon.com/cloudwatch. For the lambda function to be useful though, it usually needs to be setup with the right IAM role, VPC access and usually some sort of API gateway.

IAM (database permissions)

API gateway

For the lambda function to be easily accessible via web API (be it http or something else), an API gateway needs to be set up, see this link for a good example and the API gateway administration: https://console.aws.amazon.com/apigateway

Notes: - API gateway configuration is completely independent of the lambda function deployment and must be configured separately (i.e. no setting in the config.yaml that plays a role here) - if you want to make the API secure, good to include an API key requirement which requires creating an API key and setting up a usage plan that allows the API key for a specific API gateway and deployed stage (this stage's method must have the API Key Required setting in the Method->Method Request set to true). - API development can be very tricky, POSTMAN helps with testing APIs:

Webhooks

Lastly, the particle photons need to actually send data to the API, this is done via Webhooks.

Alternative (cut?)

serverless provides a potential deployment alternative compatible with multiple providers, not just AWS but it's a bit different setup (and not currently what we use). Below are a few notes on the approach.

serverless setup

python setup

serverless deployment



KopfLab/labwareC3 documentation built on June 30, 2023, 6:22 a.m.