AWS Chalice: Quick Start

In this post, I am going to use Chalice to deploy a sample application on AWS API Gateway and Lambda.


What is Chalice?

Chalice is an AWS framework for writing serverless applications in

Python. https://aws.github.io/chalice/quickstart.html

Similar technologies include SAM. See https://aws.github.io/chalice/faq.html for more detail.


Install

% python3 -m pip install chalice


Create Project

% chalice new-project helloworld
Your project has been generated in ./helloworld

% cd helloworld 

% tree -a
.
├── .chalice
│   └── config.json
├── .gitignore
├── app.py
└── requirements.txt

Run Locally

% chalice local
Serving on http://127.0.0.1:8000
% curl http://127.0.0.1:8000
{"hello":"world"}

Deploy & Cleanup

% chalice deploy
...
Rest API URL: https://xxxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/api/
% curl https://xxxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/api/
{"hello":"world"}
% chalice delete

Comments

Popular posts from this blog

Minikube Installation for M1 Mac

Selenide: Quick Start

PyCharm: Quick Start