Skip to content

Instantly share code, notes, and snippets.

@reisjr
Created April 5, 2017 22:57
Show Gist options
  • Save reisjr/1d081583992c0a7276e48aa52433306d to your computer and use it in GitHub Desktop.
Save reisjr/1d081583992c0a7276e48aa52433306d to your computer and use it in GitHub Desktop.
Prepare a lambda function
mkdir SampleLambdaFunction
chmod 644 SampleLambdaFunction.py
cp SampleLambdaFunction.py SampleLambdaFunction
cd SampleLambdaFunction
pip install "elasticsearch>=2.0.0,<3.0.0" -t .
pip install requests_aws4auth -t .
zip -9r ../SampleLambdaFunction.zip .
aws lambda create-function --region us-east-1 \
--runtime python2.7 \
--timeout 30 \
--description "A sample lambda function." \
--role arn:aws:iam::123456789123:role/SampleLambdaFunctionRole \
--handler SampleLambdaFunction.lambda_handler \
--function-name SampleLambdaFunction \
--zip-file fileb://../SampleLambdaFunction.zip
aws lambda update-function-code \
--function-name DVA_StreamResultsToES --zip-file fileb://../DVA_StreamResultsToES.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment