投稿数 585
公開から 2940

Serverless framework 入門 hello world


Categories: aws

Serverless frameworkとは

AWS LambdaとAWS API Gatewayを利用したサーバレスなアプリケーションを構築するためのツール。

サーバーレスアプリケーションを構築するための最も広く採用されているツールキット。

です!

hello wordしてみる

Step 1. serverlessコマンド使うのでグローバルにインストール

$ npm install serverless -g

Step 2. Login to your serverless account これはオプションなので無視していいよ!

$ serverless login

Step 3. Create a serverless function hello world appが用意されているのでそれを使いましょう!

$ serverless create --template hello-world

Step 4. デプロイ実行!

 $ serverless deploy

デプロイ実行後にURLが表示されるのでそのURLにジャンプしましょう!

$ http://xyz.amazonaws.com/hello-world

できました!!

最後に削除しましょう

削除しないと思わぬ課金を食らうことがあります。 おお、おそろしい。

serverless remove

仕組みとか、どうやってやるの?

AWSでやりたんですけど、、

AWSでやるだけでも結構網羅して理解しないとだよ。。

https://serverless.com/framework/docs/providers/aws/

参考

https://serverless.com/framework/docs/providers/aws/guide/quick-start/