AWS Chalice

learn aws/chalice

framework for writing serverless apps in python. It allows you to quickly create and deploy applications that use AWS Lambda.


  • focus is on building REST APIs (API Gateway + lambda)
  • event sources support - cron, EventBridge, S3, SNS, SQS, Kinesis, DynamoDB
  • compiles down to SAM template + zip containing python code + dependencies
  • can combine with CDK to get all CDK features + chalice easy workflow/deploy benefits


# install in isolated venv via pipx
pipx install chalice

# create new project
chalice new-project helloworld

# deploy
cd helloworld
chalice deploy

# see `helloworld/.chalice` for package artifacts

# test api gateway endpoint
# output: {"hello":"world"}

# generate package
chalice package packaged/

# SAM template created at `helloworld/packaged/sam.json`
# bundled python code + deps at `helloworld/packaged/`

# tear down
chalice delete

contents of helloworld/packaged/