EasySAM is an opinionated YAML-to-SAM generator for modular AWS serverless applications.
It helps you define Lambda functions, API Gateway routes, DynamoDB tables, S3 buckets, SQS queues, Kinesis streams, OpenSearch Serverless collections, and IoT Core authorizers in a compact resources.yaml model, then generate and deploy the resulting SAM stack.
- Simple YAML-first resource definitions
- Recursive import system (
import+ localeasysam.yaml) - Modular app structure with shared
common/code support - Built-in validation (
inspect schema,inspect cloud) - Native support for:
- DynamoDB stream triggers from table definitions
- DynamoDB TTL
- Lambda Function URLs
- Prismarine model-driven tables
- OpenSearch Serverless search collections
- MQTT/IoT Core custom authorizers
- Python 3.12+ (Your local/CI environment version should match the
python:option inresources.yamlto ensure dependency compatibility) - AWS credentials configured (named profile recommended)
- AWS SAM CLI 1.138.0+
pip25.1.1+ (used in deployment checks)- One of:
uv(recommended for project-local workflows)pipx(recommended for global CLI install)pip
Choose one installation method.
uv add --dev easysamUse as:
uv run easysam --helppipx install easysamUse as:
easysam --helppip install easysam- Create a Python project and initialize EasySAM:
mkdir my-easysam-app
cd my-easysam-app
uv init
uv add --dev easysam
uv run easysam initFor a Prismarine scaffold:
uv run easysam init --prismarine- Validate your resources:
uv run easysam --environment dev inspect schema .- Generate templates:
uv run easysam --environment dev generate .- Deploy to AWS:
uv run easysam --environment dev --aws-profile my-profile deploy . --tag project=easysam-demo- Delete stack when done:
uv run easysam --environment dev --aws-profile my-profile delete --awaitFor all options:
uv run easysam --helpprefix: MyApp
import:
- backendEasySAM recursively finds easysam.yaml files under backend/ and merges them.
lambda:
name: myfunction
resources:
tables:
- MyItem
integration:
path: /items
open: true
greedy: falseYou can also define tables locally:
tables:
MyItem:
attributes:
- name: ItemID
hash: trueTrigger a Lambda directly from table changes:
tables:
SearchableItem:
attributes:
- name: ItemID
hash: true
trigger: indexfuncAdvanced trigger configuration:
tables:
SearchableItem:
attributes:
- name: ItemID
hash: true
trigger:
function: indexfunc
viewtype: new-and-old
batchsize: 10
batchwindow: 5
startingposition: latestConditional keys are resolved against deploy context (environment, target_region):
buckets:
? !Conditional
key: my-bucket
environment: prod
region: eu-west-2
:
public: true
extaccesspolicy: ProdPolicyNegation is supported using ~ (example: environment: ~prod).
Use a context file for CI/environment-specific patches:
overrides:
buckets/my-bucket/public: trueThen pass it with:
uv run easysam --environment dev --context-file deploy-context.yaml deploy .prismarine:
default-base: common
access-module: common.dynamo_access
modelling: typed-dict
tables:
- package: myobjectSet modelling: pydantic for Pydantic-based generated clients.
mqtt:
authorizer:
function: mqtt-auth
topics:
- channels/*If a function publishes to IoT topics, add mqtt in function services.
All examples live under example/ and include focused scenarios such as:
- minimal app bootstrap
- conditionals and deploy context overrides
- custom Lambda layers
- global env vars and plugins
- DynamoDB TTL (plain + Prismarine)
- Prismarine TypedDict and Pydantic modelling
- OpenSearch Serverless + DynamoDB streams
- Kinesis with multiple S3 destinations
See the full index: example/README.md.
git clone https://github.com/adsight-app/easysam.git
cd easysam
uv sync
source .venv/bin/activateSee CHANGELOG.md.
If you hit an issue:
- Search existing issues
- Open a new issue with a reproducible example
MIT. See LICENSE.