🧩 How to Create CRUD REST API with AWS Chalice

📗 Learn how to build a book database API with AWS Chalice serverless technology.

TL;DR: In this article, you will learn how to build Serverless Python applications with AWS Chalice. You will build a book database REST API to store book entries and perform CRUD operations on the API. The code for this tutorial is available here, AWS Chalice API sample

Introduction

AWS Chalice is a serverless Python framework developed by Amazon. It shares so many similarities in syntax and semantics with Flask. Like other serverless technology, Chalice allows the developer to be able to concentrate on application development without having to deal with managing servers. It uses AWS Lambda and the Amazon API Gateway.

You will use Chalice to build a book database REST API. Your users will be able to store book entries and perform CRUD operations on the API. Entries will be stored in a DynamoDB database. It is a NoSQL database system offered by Amazon. It stores data in the form of tables, items, and attributes.

Finally, you will also see how to integrate Auth0 authentication to your AWS Chalice applications. Besides, you will use Auth0 for authorization. Authorization will allow you to distinguish the endpoints that can be accessed by the general public from the ones that the authenticated users of the application have access to.

Prerequisites

  1. Python 3.7 or later versions
  2. pip
  3. venv
  4. AWS account
  5. AWS CLI

Ensure you have Python and pip installed on your machine. You can download Python for your operating system from the official Python website. You may install pip by following these instructions.

Venv is a package for creating isolated environments for individual projects on a machine. If you installed Python 3.7 or later versions, venv would come pre-installed with the Python package.

You need an AWS account. You may sign up for one.
Check the AWS CLI v2 user guide if you do not have AWS CLI installed on your machine.

26