https://github.com/serverless/serverless
1] node-js 설치
2] npm 으로 serverless 설치
3] aws Iam 서비스에서 admin 생성 serverless-admin
4] csv 파일 다운(secret,credential)
$ serverless config credentials --provider aws --key XXX --secret YYY --profile serverless-admin
|
$ sls create --template aws-python --path hello-world-python
|
5] serverless.yml 파일 수정 필요
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
service: hello-world-python
# app and org for use with dashboard.serverless.com
#app: your-app-name
#org: your-org-name
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
provider:
name: aws
runtime: python2.7
profile: serverless-admin
region: ap-northeast-2 # url 링크 region을 참고
|
$ sls deploy -v
|
cli 실행 명령어
1
2
3
4
5
6
7
|
sls invoke -f hello -l
"Hello-World"
--------------------------------------------------------------------
START RequestId: 109b0c26-e6ea-43f3-97b6-63f96d407d06 Version: $LATEST
hi !
END RequestId: 109b0c26-e6ea-43f3-97b6-63f96d407d06
REPORT RequestId: 109b0c26-e6ea-43f3-97b6-63f96d407d06 Duration: 0.31 ms Billed Duration: 100 ms Memory Size: 1024 MB Max Memory Used: 43 MB
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
sls deploy -v
function 수정 후 명령어
sls deploy function -f hello
sls logs -f hello -t (로그 확인)