A framework for writing serverless applications
Get started
[full example]
from chalice import Chalice

app = Chalice(app_name="helloworld")

@app.route("/")
def index():
    return {"hello": "world"}

@app.schedule(Rate(5, unit=Rate.MINUTES))
def periodic_task(event):
    return {"hello": "world"}

@app.on_s3_event(bucket='mybucket')
def s3_handler(event):
    print(event.bucket, event.key)

Coding

Focus on writing your application code

Focus on writing your application code instead of the resources or services needed to deploy your application. Chalice automatically determines how to provision the necessary resources for your application.

Coding

A familiar decorator based API

Chalice's API for writing serverless application uses a familiar decorator-based syntax used in frameworks such as Flask, bottle, and FastAPI. Skip the learning curve and get up and running quickly.

Coding

Supports multiple deployment systems

Chalice supports multiple tools to deploy your application including AWS CloudFormation, Terraform, and its own built-in deployer based on the AWS SDK for Python. Use the deployment tools and services you're already familiar with.

Quickstart

Up and running in minutes

Chalice lets you quickly create and deploy python applications that use AWS Lambda. Using the Chalice CLI, you can have a REST API deployed to Amazon API Gateway and AWS Lambda in minutes.

Features

Native python packaging

Chalice has built-in support for python packaging tools. It will automatically package your application and install 3rd party dependencies specified in your requirements.txt file.

AWS SAM and Terraform integration

You can use Chalice's included deployer that's built using the AWS SDK for Python (boto3) or you can have Chalice generate packages that can be deployed with AWS CloudFormation or Terraform.

CI/CD pipeline generation

Automatically generate a deployment pipeline that's built with AWS CodePipeline and AWS CodeBuild. Deploy your application whenever you push changes to your Git repository.

Local testing support

Test your REST API using the local test server. This gives you a quicker feedback loop and let's you test your code before deploying to AWS.

Websocket APIs

Create Websocket APIs with API Gateway. Includes runtime APIs to send messages back to connected clients.

Automatic policy generation

Automatically generate policies for your application based on scanning your source code.

Learning Resources

Tutorials

See step-by-step tutorials that show you how to use various features of Chalice. These are designed to quickly get you up and running if you're new to Chalice. These are perfect for new users of Chalice.

See more.

Sample Applications

Our sample applications are complete examples that are larger in scope than our tutorials. Learn how you can combine multiple features of Chalice to create more real-world serverless applications. We walk through the architecture, deployment, and code for all of our sample applications.

See more.
Quick start ->