Created by: michaelbrewer
What is this Python project?
A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics async, parameters and secrets management, idempotency, and more.
What's the difference between this Python project and similar ones?
Tenets
This project separates core utilities that will be available in other runtimes vs general utilities that might not be available across all runtimes.
- AWS Lambda only We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported.
- Eases the adoption of best practices. The main priority of the utilities is to facilitate best practices adoption, as defined in the AWS Well-Architected Serverless Lens; all other functionality is optional.
- Keep it lean. Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
- We strive for backwards compatibility. New features and changes should keep backwards compatibility. If a breaking change cannot be avoided, the deprecation and migration process should be clearly defined.
- We work backwards from the community. We aim to strike a balance of what would work best for 80% of customers. Emerging practices are considered and discussed via Requests for Comment (RFCs) Idiomatic. Utilities follow programming language idioms and language-specific best practices.
Highlighted Features
- Tracing - Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
- Logging - Structured logging made easier, and decorator to enrich structured logging with key Lambda context details
- Metrics - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) Bring your own middleware - Decorator factory to create your own middleware to run logic before, and after each Lambda invocation
- Parameters utility - Retrieve and cache parameter values from Parameter Store, Secrets Manager, or DynamoDB
- Batch processing - Handle partial failures for AWS SQS batch processing
- Typing - Static typing classes to speedup development in your IDE
- Validation - JSON Schema validator for inbound events and responses
- Event source data classes - Data classes describing the schema of common Lambda event triggers
- Parser - Data parsing and deep validation using Pydantic
- Idempotency - Convert your Lambda functions into idempotent operations which are safe to retry
- Event Handler - Decorators to help simplify AppSync [GraphQL] and API Gateway events. Think Flask for AWS Lambda
- Feature Flags - A simple rule engine to evaluate when one or multiple features should be enabled depending on the input
More info
--
Anyone who agrees with this pull request could submit an Approve review to it.