[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)
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.
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.
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.
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.
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.
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.
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.
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.
Create Websocket APIs with API Gateway. Includes runtime APIs to send messages back to connected clients.
Automatically generate policies for your application based on scanning your source code.
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.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.