explaingit

aws/chalice

11,046PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

Chalice is AWS's Python framework for building serverless apps on AWS Lambda, you write plain Python functions with simple decorators and one command deploys the entire cloud infrastructure for you.

Mindmap

mindmap
  root((Chalice))
    What it does
      Serverless Python
      One-command deploy
      Auto permissions
    Event triggers
      HTTP routes
      Scheduled tasks
      S3 file uploads
      SQS messages
    AWS services used
      Lambda
      API Gateway
      S3
      SQS
    Setup
      pip install
      AWS credentials
      chalice deploy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build and deploy a REST API in Python that runs on AWS Lambda with no server to manage or pay for when idle.

USE CASE 2

Schedule a Python function to run every five minutes on AWS without manually configuring CloudWatch Events.

USE CASE 3

Trigger a Python function automatically whenever a file is uploaded to an S3 bucket.

USE CASE 4

Process messages from an SQS queue using a Python function that Chalice deploys and wires up automatically.

Tech stack

PythonAWS LambdaAWS API GatewayS3SQS

Getting it running

Difficulty · moderate Time to first run · 30min

Requires AWS credentials configured locally via the AWS CLI and a Python virtual environment before running chalice deploy.

In plain English

Chalice is a Python framework made by AWS for building applications that run on AWS Lambda, a cloud service where you pay only for the time your code actually runs rather than keeping a server running continuously. The idea is that you write Python functions, decorate them with a few special markers, and Chalice handles deploying all the necessary AWS infrastructure for you with one command. The framework covers several common patterns. You can define HTTP endpoints that act as a REST API by decorating a Python function with the route you want it to respond to. You can define tasks that run on a schedule, like every five minutes, by decorating a function with a rate or cron expression. You can also trigger functions in response to events from other AWS services: a file uploaded to an S3 storage bucket can automatically call a function, and messages sent to an SQS message queue can do the same. Chalice also generates the required AWS permissions policies automatically when you deploy, which removes a common source of configuration errors. Setting up a new project follows a short sequence: install Chalice via pip in a Python virtual environment, ensure your AWS credentials are configured, run chalice new-project to create a project folder with a starter app.py file, and then run chalice deploy to publish it. The deploy command creates the Lambda function, the API Gateway endpoint, and any other AWS resources the app needs, then prints out the live URL. Re-running chalice deploy after making changes updates the live deployment in place. The chalice delete command removes all the resources Chalice created. Full documentation, tutorials, and an API reference are available at the project website. Supported Python versions match whatever AWS Lambda currently supports, which at the time of this writing ranges from Python 3.10 through 3.14.

Copy-paste prompts

Prompt 1
Using AWS Chalice, write a Python REST API with a GET /users endpoint that reads from DynamoDB and returns JSON, then show me the deploy command.
Prompt 2
Create a Chalice app that processes messages from an SQS queue and writes results to an S3 bucket, include the full app.py and the deploy steps.
Prompt 3
I have a Chalice app deployed on Lambda. How do I add a scheduled task that runs every 6 hours to clean up old DynamoDB records?
Prompt 4
Walk me through adding environment variables and the correct AWS IAM permissions to a Chalice project so it can read from S3 and write to RDS.
Prompt 5
Convert this Flask route into a Chalice route and show me what changes are needed in app.py to make it work on AWS Lambda: [paste your Flask code].
Open on GitHub → Explain another repo

← aws on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.