Open mizmarine opened 5 years ago
getting started https://serverless.com/framework/docs/getting-started/
install
npm install -g serverless
quick start with aws https://serverless.com/framework/docs/providers/aws/guide/quick-start/
serverless framework は awsによらずマルチクラウド対応なのでした
env
(3.6.0_playground) (`・ω・')っ旦 node -v
v11.9.0
(3.6.0_playground) (`・ω・')っ旦 npm -v
6.10.2
(3.6.0_playground) (`・ω・')っ旦 serverless -v
1.48.3 (Enterprise Plugin: 1.3.2, Platform SDK: 2.1.0)
プロジェクト作成 なんか自動でモニタリング環境も作ってくれるらしい?のでアカウントつくてみた
(`・ω・')っ旦 serverless
Serverless: No project detected. Do you want to create a new one? Yes
Serverless: What do you want to make? AWS Python
Serverless: What do you want to call this project? echo
Project successfully created in 'echo' folder.
You can monitor, troubleshoot, and test your new service with a free Serverless account.
Serverless: Would you like to enable this? Yes
You are not logged in or you do not have a Serverless account.
Serverless: Do you want to register? Yes
Serverless: email: <mail@example.com>
Serverless: password: [hidden]
Successfully registered your new account
Your project is setup for monitoring, troubleshooting and testing
Deploy your project and monitor, troubleshoot and test it:
- Run “serverless deploy” to deploy your service.
- Run “serverless dashboard” to view the dashboard.
デフォルトでは node / python しか選択肢なかったけど 他のruntimeももちろん指定できるっぽい https://serverless.com/framework/docs/providers/aws/cli-reference/create/
Looking to get started with something other than Node or Python? No problem. You can use thecreate command to get started with a variety of other languages.
deploy
serverless deploy -v
これやると、serverless.yml の中身をみてよしなにリソースをつくってくれるっぽい っていうか勝手につくってしまうっぽい。笑 cloudformation wrapper って感じやな。
なおデフォルトリージョンは us-east-1 っぽい。。?
invoke
serverless invoke -f hello -l
log tail -f みたいなかんじだ
serverless logs -f hello -t
remove
serverless remove