Skip to content

Instantly share code, notes, and snippets.

@ayemos
Created April 7, 2017 03:07
Show Gist options
  • Save ayemos/e9920407fdfd5d1f9f15dec7975b13e3 to your computer and use it in GitHub Desktop.
Save ayemos/e9920407fdfd5d1f9f15dec7975b13e3 to your computer and use it in GitHub Desktop.
lammaで始める等身大のAWS Lambda ref: http://qiita.com/ayemos/items/acc212261dc6f39cb1cf
$ gem install lamma
$ lamma init my_function --runtime=python2.7
Looks like you didn't specified role arn for the function.
Do you want me to create default IAM role and configure it (my_function-lamma-role)? (y/n) y
I, [2017-04-06T22:28:53.952278 #5027] INFO -- : Creating role my_function-lamma-role
I, [2017-04-06T22:28:54.863304 #5027] INFO -- : Checking attached role policies for my_function-lamma-role
I, [2017-04-06T22:28:55.243400 #5027] INFO -- : Could not find AWSLambdaBasicExecutionRole policy. Attatching.
I, [2017-04-06T22:28:55.243449 #5027] INFO -- : Attaching minimal policy (AWSLambdaBasicExecutionRole) to my_function-lamma-role
I, [2017-04-06T22:28:55.466092 #5027] INFO -- : Done
create /workspace/my_function/lambda_function.py
create /workspace/my_function/lamma.yml
I, [2017-04-06T22:28:55.468021 #5027] INFO -- : Initializing git repo in /workspace/my_function
$ ls
total 16
drwxr-xr-x 5 yuichiro-someya staff 170 4 6 22:28 ./
drwxr-xr-x 3 yuichiro-someya staff 102 4 6 22:28 ../
drwxr-xr-x 10 yuichiro-someya staff 340 4 6 22:28 .git/
-rw-r--r-- 1 yuichiro-someya staff 357 4 6 22:28 lambda_function.py
-rw-r--r-- 1 yuichiro-someya staff 207 4 6 22:28 lamma.yml
$ lamma deploy -a production
Function my_function doesn't seem to be exist on remote.
Do you want me to create it? (y/n) y
I, [2017-04-06T22:29:14.113561 #9209] INFO -- : Creating new function my_function...
I, [2017-04-06T22:29:14.123244 #9209] INFO -- : Saved the build: /var/folders/kd/_chs6sw13jvg01hlq6nd50k00000gp/T/lamma/05f92074cf833092343cd5414754efef
I, [2017-04-06T22:29:14.448724 #9209] INFO -- : Created new function arn:aws:lambda:ap-northeast-1::function:my_function
I, [2017-04-06T22:29:14.448780 #9209] INFO -- : Publishing...
I, [2017-04-06T22:29:14.605540 #9209] INFO -- : Published $LATEST version as version 1 of funtion: arn:aws:lambda:ap-northeast-1::function:my_function:1
Function alias PRODUCTION doesn't seem to be exist on remote.
Do you want me to create it? (y/n) y
lamma init my_function --runtime=python2.7
lamma deploy -a production
$ cat lamma.yml
function:
name: my_function
role_arn: arn:aws:iam:::role/my_function-lamma-role
description: Hello, world.
timeout: 3
memory_size: 128
runtime: python2.7
region: ap-northeast-1
lamma rollback -a production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment