LINE BOT to log your drink on AWS Lambda with AWS API Gateway, DynamoDB, S3, Google Custom Search API and LINE Messaging API. Using AWS SAM.
aws-sam-local:sam version 0.2.6- Installation:
npm install -g aws-sam-local
- Installation:
- Python 2.7
- AWS Account
- API Gateway
- Lambda
- DynamoDB
- S3
- LINE BOT Account
- Google API
- Custom Search API
Change attributes in template.yaml.
__AWS_ACCOUNT____LINE_CHANNEL_ACCESS_TOKEN____GOOGLE_API_KEY____GOOGLE_CUSTOM_SEARCH_ID____S3_REGION_DOMAIN____S3_BUCKET_NAME__
- Set awscli config
- Set environment variable for
build_image.shand a build script of lambda functions.
git clone https://github.com/irotoris/drink_logger_line_bot.git
cd drink_logger_line_bot
export SAM_DST_S3_BUCKET=<YOUR_S3_BUCKET_FOR_AWS_SAM>`
sh build_image.sh
- Generate a template file.
sam package \
--template-file template.yaml \
--s3-bucket $SAM_DST_S3_BUCKET \
--output-template-file packaged-template.yaml
You get packaged-template.yaml by AWS CloudFormation.
- Create your LINE BOT Account and Access token
- Create S3 bucket and Publish
- Deploy AWS SAM
sam deploy \
--template-file packaged-template.yaml \
--capabilities CAPABILITY_IAM \
--stack-name <YOUR_STACK_NAME>
You get Bot Endpoint on API Gateway AWS Console, and set LINE BOT ENDPOINT on LINE Developers Console.
MIT License