AWS Serverless Application Model(SAM) を使用したサンプルコードです。
- src - Lambda functionで使用されるコード.
- events - Invocation events that you can use to invoke the function.
- tests - Unit tests for the application code.
- template.yaml - A template that defines the application's AWS resources.
- samconfig.toml -
sam deploy
実行時に参照される設定ファイル.
sam build
sam deploy --guided # --guidedオプションを使用するのは初回のみ.
aws-sam-practise$ sam build --use-container
aws-sam-practise$ sam local start-api
aws-sam-practise$ curl http://localhost:3000/
Run functions locally and invoke them with the sam local invoke
command.
aws-sam-practise$ sam local invoke HelloWorldFunction --event events/event.json
aws-sam-practise$ sam logs -n DefaultFunction --stack-name aws-sam-practise --tail
aws-sam-practise$ python -m pytest tests/ -v
aws cloudformation delete-stack --stack-name aws-sam-practise
- BillingModeの変更
- GSIの追加, 変更
See the AWS SAM developer guide for an introduction to SAM specification, the SAM CLI, and serverless application concepts.
Next, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: AWS Serverless Application Repository main page