Skel for Lambda Functions
I wanted to create a small app as a starting point for creating AWS Lambda functions. This is it.
This repo assumes you have the awscli set up and configured with the right account/credentials.
Below you'll be told to edit the variables in the Makefile. Here is an explanation for each of them.
bucket_nameThis is a unique to AWS bucket name where you want to upload your zip file. It is used for both creating a bucket and designating where to upload to. You can set this to a preexisting bucket name.
function_pkgThis is the name of the Lambda Function. We'll use it to name it in the interface, and the name of the zip file.
zip_fileAdds the .zip to the function_pkg above.
runtimeI wouldn't change this, but you can if you are trying to adapt this creating your own node/java skel.
iam_roleThe function will need an IAM role if you want to talk to AWS resources.
handlerThis is name_of_python_file.name_of_method that will be used as the entry point of execution.
timeoutThis is how long you want to attempt execution before AWS aborts.
memoryThis is how much memory you think the function show have access to.
subnetsThis is the subnet(s) ID(s) where you want your Lambda function to execute in. If you want to execute against your other AWS resources, this needs to be a private subnet, with a route to a NAT Gateway in a public subnnet.
sec_groupsAssociated Security Group(s) ID(s) the function will be goverend by.
vpc_configPassing in the Security Groups and Subnets to the VPC.
$ vim Makefile # edit variables as needed
$ make bucket
$ make build
$ make publish
$ make run
Then edit the myfunction.py file to do what it is you're trying to do. Rebuild, and republish.
Then get rid of it all
$ make clean