/aws-chalice-swagger

AWS Chalice Starter Template with Build-in Swagger UI Support

Primary LanguagePythonApache License 2.0Apache-2.0

AWS Chalice Template Project with Swagger UI

AWS Chalice Starter Template with Build-in Swagger UI Support

AWS Chalice

AWS Chalice is a micoservice framework for writing serverless appications in python. User can quickly create and deploy applications to AWS environment.


What is this project?

This project provides a ready-to-use template for your project. The biggest value-add is the built-in Swagger UI.


Prerequisite


Install

Clone Git Repository to your local file system

git clone https://github.com/samuelkhtu/aws-chalice-template.git

Navigate to the aws-chalice-template folder

cd aws-chalice-template

Setup Python Virtual Environment

python -m venv .venv

Activate Python Virtual Environment

# Mac
source .venv/bin/Activate

# Window
source .venv/Scripts/Activate

Install Required Python Library

pip install -r requirements.txt

Deploy To AWS

❯ chalice deploy 

Updating lambda function: aws-chalice-template-dev
Updating rest API
Resources deployed:
  - Lambda ARN: arn:aws:lambda:us-east-1::function:aws-chalice-template-dev
  - Rest API URL: https://...execute-api.us-east-1.amazonaws.com/dv/

Copy & paste the URL from your terminal to your browser. You should see the familiar Swagger UI.


Environment Setup

Log Level

Log level is controlled by ENV_LOG_LEVEL environment variables. .chalice\config.json

  • CRITICAL

  • ERROR

  • WARNING

  • INFO

  • DEBUG

  • NOTSET

  • Reference: logging level


Custom IAM Role Policy

You can customize the IAM role policy with your project.