Pydantic Settings with AWS Secrets Manager

Intro If you are already familiar with Pydantic, one of the useful components of Pydantic is the Settings Management. This will allow you to read settings variables from different sources and parse and validate them into class(es) using Pydantic. Let’s see a minimal example. First we need to set up the variable: $ export API_KEY=xxx And then we can read it into the Settings class with: from pydantic import BaseSettings class Settings(BaseSettings): api_key: str print(Settings()....

January 26, 2023 · 5 min · 1002 words · Amin
AWS Lambgda

FastAPI AWS Lambda deployment

Intro From AWS website: AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. Even though it’s not required to use a web framework like FastAPI or Django to start using AWS Lambda, often it is the case you have an existing project or you want to use a framework for useful features....

November 1, 2022 · 4 min · 699 words · Amin