Serverless Frameworkを使ってLineBot用のバックエンドを構築します
- Python 3.9
- AWS
- Lambda
- API Gateway
- DynamoDB
以下の手順でデプロイします。 事前にAWSのプロファイルを設定が必要です。
$ aws configure --profile profile_sample
- .env.sampleを参考に.envファイルを作成して設定
$ cp .env.sample .env
- プラグインのインストール
$ sls plugin install -n serverless-python-requirements
- デプロイ
$ sls deploy --aws-profile profile_sample --stage dev
デプロイ後に発行されたエンドポイントをLineMessagingAPIのWebhook URLに設定してください
作成したリソースを削除する場合はsls removeを使用してください。
$ sls remove --aws-profile profile_sample --stage dev