A template for AWS lambda function implementation in ruby
Generate aws-lambda-function.zip
using:
$ bin/build
Set environment variables:
NAME
- name of lambda functionAWS_CODE_BUCKET
- name ofS3
bucket for storing codeAWS_CODE_OBJECT_KEY
- key forS3
object
Create lambda function:
$ aws cloudformation create-stack \
--stack-name $NAME \
--template-body cloudformation/lambda.template \
--capabilities CAPABILITY_NAMED_IAM \
--parameters \
ParameterKey='Name',ParameterValue=$NAME \
ParameterKey='CodeBucket',ParameterValue=$AWS_CODE_BUCKET \
ParameterKey='CodeObjectKey',ParameterValue=$AWS_CODE_OBJECT_KEY