Permalink
Browse files

Add the delete/create/invoke targets

  • Loading branch information...
1 parent 6721e9e commit 7bf6c4e5d6f745d636dbdc6737db7f23a4371085 @adomokos committed May 24, 2016
Showing with 26 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +25 −0 Makefile
View
@@ -1,3 +1,4 @@
hello-1.0.0-osx/
hello-1.0.0-linux-x86_64/
deploy/
+tmp/
View
@@ -34,6 +34,31 @@ run: ## Runs the code locally
@chmod +x $(OSXDIR)/hello
@cd $(OSXDIR) && ./hello
+create: ## Creates an AWS lambda function
+ aws lambda create-function \
+ --function-name HelloFromRuby \
+ --handler index.handler \
+ --runtime nodejs4.3 \
+ --memory 512 \
+ --timeout 10 \
+ --description "Saying hello from MRI Ruby" \
+ --role arn:aws:iam::___xyz___:role/lambda_basic_execution \
+ --zip-file fileb://./deploy/hello_ruby.zip
+
+delete: ## Removes the Lambda
+ aws lambda delete-function --function-name HelloFromRuby
+
+invoke: ## Invoke the AWS Lambda in the command line
+ rm -fr tmp && mkdir tmp
+ aws lambda invoke \
+ --invocation-type RequestResponse \
+ --function-name HelloFromRuby \
+ --log-type Tail \
+ --region us-east-1 \
+ --payload '{"name":"John Adam Smith"}' \
+ tmp/outfile.txt \
+ | jq -r '.LogResult' | base64 -D
+
.PHONY: help
help:

0 comments on commit 7bf6c4e

Please sign in to comment.