LoginSignup
0

More than 3 years have passed since last update.

ServerLess Framework 技術調査

Posted at

公式Document: https://serverless.com/framework/docs/

Install

NPMで管理されてるっぽい。Node 6.0以上が必要。
参考: https://serverless.com/framework/docs/providers/aws/guide/quick-start/


npm install -g serverless
serverless -v
sls -v

AWSのセットアップ関連は省略
参考: https://serverless.com/framework/docs/providers/aws/guide/credentials/

Create

プロジェクトを作成


sls

Test

Lambdaの実行テスト

sls invoke -f hello
sls invoke local -f hello # ローカル環境のコードを走らせる場合
sls logs -f hello # ログを見る
  • -f hello 実行する関数を指定

Deploy

sls deploy -v -r ap-northeast-1
sls deploy function -f hello -r ap-northeast-1
  • -v Stackの状況を出力
  • -r ap-northeast-1 関数を作成するRegionを指定。serverless.ymlからも指定できる。
  • -s dev 関数を作成するStageを指定。メリットは今の所わからない。
  • --aws-s3-accelerate s3へのUploadが早くなる?!

Delete

sls remove

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0