Table of Contents
![Chalice Examples][product-screenshot]
Here's why:
- Chalice will take care of deployment
- We can run api services in local with using the aws credentials
- Using the single config.json we can configure the all services
- python
sudo apt install python3 source venv/bin/activate
-
Clone the repo
git clone https://github.com/venkateshchary/Chalice-lambda-python.git
-
Install Python packages
source venv/bin/activate pip3 install chalice pip3 install flask -
Create chalice app
chalice new-project hello_aws chalice local # to run the dev stage
-
Add configurations in
config.json{"version": "2.0","app_name": "dev_hello","stages": { "dev": { "api_gateway_stage": "api", "manage_iam_role":false, "iam_role_arn":"arn:aws:iam::xxxxx:role/user_role", "subnet_ids": ["subnet-xxxxx", "subnet-xxxxx", "subnet-xxxxx"], "security_group_ids": ["sg-xxx"], "layers": ["arn:aws:lambda:xxxxx:layer:pymysql-py36:1"], "lambda_functions": { "hello_world": { "lambda_timeout": 60 }, "processors": { "lambda_timeout": 900, "lambda_memory_size": 960 } }, "environment_variables":{ "bucket_name":"s3_bucket", "database":"db_name", "username":"username", "password":"rds password", "host":"rds host url" }, "tags": { "owner":"USER", "purpose":"engineering", "environment":"dev", } } } }
Distributed under the MIT License. See LICENSE for more information.