Blazing Fast AWS Lambda Build System with Global Project Detection
Project description
Autoklug - Blazing Fast AWS Lambda Build System
A blazing fast, high-performance AWS Lambda deployment system that works globally in any project with automatic context detection. Makes complex AWS infrastructure "stupid simple" with minimal configuration.
๐ Core Principles
- Unified Developer Experience: One CLI, consistent interface
- Build Locally, Deploy Globally: Local development with seamless AWS deployment
- Stupid Simple: Complex AWS infrastructure made accessible with minimal configuration
- Production Ready: Enterprise-grade features with developer-friendly interfaces
# Autoklug Commands
autoklug init # Initialize project
autoklug run # Local development server
autoklug deploy # Deploy to AWS Lambda
autoklug deploy --validate # Deploy with enhanced validation
๐ Features
- โก Parallel Processing: Layers, functions, and APIs built simultaneously
- ๐ Smart Comparison: Only updates what's changed using SHA256 hashing
- ๐ฆ S3 Requirements Checking: Compares local requirements.txt with S3
- ๐ Public API Detection: Automatically configures public APIs without authorizers
- ๐ฆ Rate Limiting: Built-in throttling for public APIs
- ๐ Global Usage: Works in any project with auto-detection
- ๐จ Beautiful CLI: Click-based CLI with progress bars and colored output
- ๐ง Zero Configuration: Just run
autoklug buildfrom any project
๐ฆ Installation
pip install autoklug
๐ฏ Quick Start
Zero Configuration Usage
# Just run from any project directory - it detects everything!
autoklug build
With Explicit Configuration
# Override auto-detection if needed
autoklug build --tool .tool.dev --env .env.dev
Individual Components
# Build only layers
autoklug layers
# Build only functions
autoklug functions
# Build only API Gateway
autoklug api
Local Development
# Start local development server
autoklug run
# With custom port
autoklug run --port 8080
# With authorizer simulation
autoklug run --use-authorizer
# With custom configuration
autoklug run --tool .tool.dev --env .env.dev
Project Analysis
# See what the system detects
autoklug detect
# Show configuration
autoklug config
๐ Project Context Detection
Autoklug automatically detects:
Configuration Files
.tool,.tool.dev,.tool.prod,.tool.public, etc..env,.env.dev,.env.prod, etc.- Preference: Uses
.tooland.envover environment-specific versions
Project Structure
- API Directories:
api/,api_public/,src/api/,functions/,lambda/ - Layer Directories:
layers/,lambda_layers/,src/layers/
Infrastructure Detection
- From File Names: Detects
prod,staging,devfrom.tool.*files - Default: Uses
devif not detected - Public APIs: Detects from
api_public/or.tool.public.*files
๐ Example Detection Output
$ autoklug detect
๐ Project Context Detection
========================================
Current directory: /path/to/my-project
Detected infrastructure: prod
Public API detected: True
๐ Configuration Files:
Tool files found: ['.tool.public.prod', '.tool.dev', '.tool']
Env files found: ['.env.prod', '.env.dev', '.env']
Selected tool file: .tool.public.prod
Selected env file: .env.prod
๐ Project Structure:
API paths found: ['./api', './api_public']
Layer paths found: ['./layers']
๐จ CLI Commands
| Command | Description | Auto-Detection |
|---|---|---|
autoklug build |
๐๏ธ Build complete infrastructure | โ |
autoklug layers |
๐ฆ Build only Lambda layers | โ |
autoklug functions |
โก Build only Lambda functions | โ |
autoklug api |
๐ Build only API Gateway | โ |
autoklug run |
๐ Start local development server | โ |
autoklug config |
โ๏ธ Show configuration info | โ |
autoklug detect |
๐ Show project detection | โ |
autoklug demo |
๐จ Run logging demo | โ |
๐ง Project Structure Support
Autoklug works with any of these common project structures:
Standard Structure
my-project/
โโโ .tool
โโโ .env
โโโ api/
โ โโโ health/
โ โ โโโ get.py
โ โโโ users/
โ โโโ get.py
โ โโโ post.py
โโโ layers/
โโโ shared/
โโโ thirdparty/
โโโ requirements.txt
Public API Structure
my-project/
โโโ .tool.public
โโโ .env
โโโ api_public/
โ โโโ health/
โ โโโ catalog/
โโโ layers/
Environment-Specific Structure
my-project/
โโโ .tool.dev
โโโ .tool.prod
โโโ .env.dev
โโโ .env.prod
โโโ api/
โโโ layers/
โ๏ธ Configuration Files
.tool File Example
# AWS Configuration
AWS_PROFILE_BUILD=default
AWS_REGION=eu-west-3
AWS_ACCOUNT_ID=123456789012
# Application Configuration
APP_NAME=my-app
PUBLIC_APP_NAME=my-app-public
INFRA=dev
# Lambda Configuration
LAMBDA_RUNTIME=python3.11
LAMBDA_ROLE=arn:aws:iam::123456789012:role/lambda-execution-role
# Layer Configuration
LAYER_PATH=./layers
LAYER_COMPATIBLE_RUNTIMES=python3.11
LAYER_ARCHITECTURE=x86_64
# API Configuration
API_PATH=./api
AUTHORIZER_FUNCTION_NAME=api-my-app-dev-authorizer
# S3 Configuration for requirements.txt checking (auto-generated from APP_NAME)
# Bucket name will be: <APP_NAME>-requirements-txt-bucket
# Example: my-app-requirements-txt-bucket
.env File Example
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/my_app_dev
# External Services
UPLOADS_CDN=https://cdn.example.com
API_BASE_URL=https://api.example.com
# Feature Flags
ENABLE_FEATURE_X=true
DEBUG_MODE=true
๐ Performance Benefits
- Parallel Processing: Up to 10 concurrent Lambda updates
- Smart Comparison: SHA256 hashing prevents unnecessary rebuilds
- S3 Integration: Requirements.txt comparison without local rebuilds
- Boto3 Optimization: Adaptive retries and connection pooling
- Async/Await: Non-blocking I/O operations
๐ฏ Use Cases
Development
- Local Development: Quick builds during development
- Feature Branches: Deploy to dev environment
- Testing: Validate changes before production
CI/CD
- GitHub Actions: Automated deployments
- Jenkins: Build pipeline integration
- GitLab CI: Continuous deployment
Production
- Blue-Green Deployments: Zero-downtime updates
- Rollback Support: Quick reversion capabilities
- Monitoring: Health checks and validation
๐ง Advanced Usage
Force Layer Updates
autoklug build --force-update-layers
Dry Run Mode
autoklug build --dry-run
Verbose Logging
autoklug build --verbose
Custom Configuration
autoklug build --tool .tool.prod --env .env.prod
๐ ๏ธ Development
Install Development Dependencies
pip install autoklug[dev]
Run Tests
pytest
Code Formatting
black autoklug/
Type Checking
mypy autoklug/
๐ Documentation
๐ค Contributing
Contributions are welcome! Please see our Contributing Guide for details.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: luis@kluglabs.com
Made with โค๏ธ by Luรญs Miguel Sousa
Blazing fast AWS Lambda deployments, globally! ๐
Project details
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 autoklug-2.0.3.tar.gz.
File metadata
- Download URL: autoklug-2.0.3.tar.gz
- Upload date:
- Size: 62.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0781730722827c353e74783e462d1fc1399ef1ca16bbf29b196e9b78361237ac
|
|
| MD5 |
1572cb658d648725de06f810273f398d
|
|
| BLAKE2b-256 |
616bb4ae503131ec348e87c6a8fb27e4fed0d2ba67e0e274250a9021d991b0f7
|
File details
Details for the file autoklug-2.0.3-py3-none-any.whl.
File metadata
- Download URL: autoklug-2.0.3-py3-none-any.whl
- Upload date:
- Size: 73.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f34f24c52b507a9d21f6e32339483a99f6f600718a4d7a7e6942e1035d39ae7
|
|
| MD5 |
5c8b992b2b845ca0cd053b25ee2f7b36
|
|
| BLAKE2b-256 |
7eb4cd2f4b97ede188a29011d52bdba5188bad13ffeec3c2ca32260201396f91
|