Opinionated Modular Cloud Deployment Tool (EasySAM)
Project description
EasySAM
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.
Why EasySAM
- 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:
- Environment variable expansion and
.envloading - DynamoDB stream triggers from table definitions
- DynamoDB TTL
- Lambda Function URLs
- Prismarine model-driven tables
- OpenSearch Serverless search collections
- MQTT/IoT Core custom authorizers
- Environment variable expansion and
Prerequisites
- 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
Installation
Choose one installation method.
Option A: project-local with uv
uv add --dev easysam
Use as:
uv run easysam --help
Option B: global with pipx
pipx install easysam
Use as:
easysam --help
Option C: global/local with pip
pip install easysam
Quick start (5 minutes)
- Create a Python project and initialize EasySAM:
mkdir my-easysam-app
cd my-easysam-app
uv init
uv add --dev easysam
uv run easysam init
For 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 --await
For all options:
uv run easysam --help
Minimal resources.yaml
prefix: MyApp
import:
- backend
EasySAM recursively finds easysam.yaml files under backend/ and merges them.
Local import file format (easysam.yaml)
lambda:
name: myfunction
resources:
tables:
- MyItem
integration:
path: /items
open: true
greedy: false
You can also define tables locally:
tables:
MyItem:
attributes:
- name: ItemID
hash: true
Key concepts
Environment Variables and .env files
EasySAM automatically loads .env files if present in the target directory. It evaluates environment variables using the standard ${MY_VAR} syntax in both global (resources.yaml) and local (easysam.yaml) files immediately after they are loaded.
You can also pass environment variables to your functions directly using the envvars property.
functions:
myfunc:
uri: "src/"
envvars:
API_URL: "${API_URL}"
LOG_LEVEL: "DEBUG"
DynamoDB table triggers
Trigger a Lambda directly from table changes:
tables:
SearchableItem:
attributes:
- name: ItemID
hash: true
trigger: indexfunc
Advanced trigger configuration:
tables:
SearchableItem:
attributes:
- name: ItemID
hash: true
trigger:
function: indexfunc
viewtype: new-and-old
batchsize: 10
batchwindow: 5
startingposition: latest
Conditional resources
Conditional keys are resolved against deploy context (environment, target_region):
buckets:
? !Conditional
key: my-bucket
environment: prod
region: eu-west-2
:
public: true
extaccesspolicy: ProdPolicy
Negation is supported using ~ (example: environment: ~prod).
Deployment context overrides
Use a context file for CI/environment-specific patches:
overrides:
buckets/my-bucket/public: true
Then pass it with:
uv run easysam --environment dev --context-file deploy-context.yaml deploy .
Prismarine integration
prismarine:
default-base: common
access-module: common.dynamo_access
modelling: typed-dict
tables:
- package: myobject
Set modelling: pydantic for Pydantic-based generated clients.
MQTT / IoT Core custom authorizer
mqtt:
authorizer:
function: mqtt-auth
topics:
- channels/*
If a function publishes to IoT topics, add mqtt in function services.
Documentation
Examples
All examples live under example/ and include focused scenarios such as:
- minimal app bootstrap
- conditionals and deploy context overrides
- custom Lambda layers
- global and local env vars (with
.envfile support) 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.
Development
git clone https://github.com/adsight-app/easysam.git
cd easysam
uv sync
source .venv/bin/activate
Changelog
See CHANGELOG.md.
Support
If you hit an issue:
- Search existing issues
- Open a new issue with a reproducible example
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easysam-1.11.1.tar.gz.
File metadata
- Download URL: easysam-1.11.1.tar.gz
- Upload date:
- Size: 146.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c02a9f2e6e33062ec15401b85fb0e4753ef68a66222375aae4c6d4b6ea64cdbc
|
|
| MD5 |
cf6ffbecf2b13d3332138abbddd47fe8
|
|
| BLAKE2b-256 |
e72205a3f60449af8c6a17efd31b29bed6ce5f604857fad85e6c6d807594818d
|
Provenance
The following attestation bundles were made for easysam-1.11.1.tar.gz:
Publisher:
publish.yml on scartill/easysam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easysam-1.11.1.tar.gz -
Subject digest:
c02a9f2e6e33062ec15401b85fb0e4753ef68a66222375aae4c6d4b6ea64cdbc - Sigstore transparency entry: 1348493929
- Sigstore integration time:
-
Permalink:
scartill/easysam@6d33b77c8db543db60ceeb42cf7e0be9346ec47f -
Branch / Tag:
refs/tags/1.11.1 - Owner: https://github.com/scartill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d33b77c8db543db60ceeb42cf7e0be9346ec47f -
Trigger Event:
push
-
Statement type:
File details
Details for the file easysam-1.11.1-py3-none-any.whl.
File metadata
- Download URL: easysam-1.11.1-py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96ddd98bd9b6a9e4187999435bfd39a60daf137464d8604bf25327db783ec6f4
|
|
| MD5 |
b7045396a4e39790ba337e9d81e3cae7
|
|
| BLAKE2b-256 |
9f9a77e0fb5b9740eace39dfdcbe1af299d2c6f8371d16e0435c7d965c3ab119
|
Provenance
The following attestation bundles were made for easysam-1.11.1-py3-none-any.whl:
Publisher:
publish.yml on scartill/easysam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easysam-1.11.1-py3-none-any.whl -
Subject digest:
96ddd98bd9b6a9e4187999435bfd39a60daf137464d8604bf25327db783ec6f4 - Sigstore transparency entry: 1348494104
- Sigstore integration time:
-
Permalink:
scartill/easysam@6d33b77c8db543db60ceeb42cf7e0be9346ec47f -
Branch / Tag:
refs/tags/1.11.1 - Owner: https://github.com/scartill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d33b77c8db543db60ceeb42cf7e0be9346ec47f -
Trigger Event:
push
-
Statement type: