As a start point, I was reading this article :
https://aws.amazon.com/fr/blogs/compute/clojure/
But I can't find a way to create the first sort of Lambda.
I choose to create a simple "Event Lambda" and track there every step.
First you need to check, pip is installed (via pip --version
). If not on MacOs, installation is pretty simple.
sudo easy_install pip
pip install --upgrade awscli --user
In your .bash_profile, add the following line.
export PATH=$PATH:$HOME/Library/Python/2.7/bin
In the console, click on your name in navbar. Choose 'security informations'.
Create an Access Key Id if needed.
You need a role with specific rights to create a function.
In IAM, choose Role in left menu, then create a new role with strategy "AWSLambdaExecute".
Note your region name (ex. us-east-2)
Run aws configure
and give it the previous informations.
Your function code will be contain in an uberjar, to build it run lein uberjar
For the first deployment, you must read a 'create function' command.
aws lambda create-function \
--function-name clj-hello \
--handler hello \
--runtime java8 \
--memory 512 \
--timeout 10 \
--role <YOUR_PREVIOUSLY_CREATED_ROLE> \
--zip-file fileb://./target/clojure-aws-lambda-0.1.0-standalone.jar
After the first deployment, you just want to push new code to existing lambda.
aws lambda update-function-code \
--function-name clj-hello \
--zip-file fileb://./target/clojure-aws-lambda-0.1.0-standalone.jar