AWS Lambda is a serverless setup for executing functions in the cloud. It leverages existing Amazon Web Services technologies to infinitely scale and run only when necessary in it's own isolated environment. Using Lambda, you can upload your code, configure it to run based on a variety of triggers, and then automatically decommission the process when complete. It operates on a pay-per-use model and is extremely cost effective and easy to scale.
AWS Lambda supports code written in Node.js (JavaScript), Python, Java (Java 8 compatible) and C# (.NET Core). Your code can include existing libraries, even native ones.
HTTP Endpoints
Unlike most file paths, the S3 key name (JSON Schema: $.Records[0].s3.object.key
) does not include a leading slash. So, if you have a file in the path s3://mybucket/path/file.txt
, the key will be path/file.txt
In Python at least, the key field value is UTF-8 URL encoded. This is noticeable when the filename contains spaces or non-ascii characters. The field needs to be URL decoded, then UTF-8 decoded - See Get non-ASCII filename from S3 notification event in Lambda
It is possible to have multiple of the same (or different) actions inside of the "Records"
key of the event; however, in practice, you will usually see one event per invocation of your Lambda function.
There are actually sample events in the Lambda console, if you choose Actions -> Configure Test Event. However, You can see the PUT operation in the examples above.
You can modify and submit test events from the AWS Lambda console to see how your function responds.
"Serverless" is a framework: https://serverless.com/
At the time of this writing (Jan 2017), the following components will need to be installed on your machine in this order. The machine I used had Windows 10 Home installed.
Each of these components are actively developed and released, so double check the links and versions and update this document when needed.
Each of these can take some time to install, so be patient, do one at a time to minimize mistakes.
Lastly, rebooting Windows before starting development is sad, but always a good idea after doing major development tool installations on a Windows box.