crhelper
crhelper simplifies authoring CloudFormation Custom Resources
What it is and what it does
crhelper is a decorator-based library that wraps CloudFormation custom resource handlers to eliminate boilerplate and ensure robust error handling. It guarantees CloudFormation receives a response even when exceptions occur, catches Lambda timeouts, and provides structured JSON logging with request and stack IDs for tracing. The library supports long-running operations via polling, which re-invokes the Lambda function every 2 minutes until completion, bypassing the 15-minute Lambda timeout limit.
You use it by decorating handler functions for create, update, and delete lifecycle events, then calling the helper instance in your main handler. It manages response formatting, error propagation to CloudFormation stack events, and optional CloudWatch Events scheduling for polling workflows. Static typing is supported for mypy compatibility.
Use it for:
- Create custom CloudFormation resources that provision third-party APIs or non-AWS services without writing response boilerplate.
- Implement long-running provisioning tasks that exceed Lambda's 15-minute timeout using the polling decorator pattern.
- Ensure CloudFormation stacks fail gracefully with meaningful error messages when custom resource handlers encounter exceptions.
- Trace CloudFormation events through Lambda logs using structured JSON output with stack and request IDs.
- Deploy infrastructure-as-code patterns that require custom logic beyond CloudFormation's native resource types.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Simplifies writing CloudFormation custom resources by handling responses, exception trapping, timeouts, and structured logging for AWS Lambda functions.
Yes, if you are writing CloudFormation custom resources in Lambda. The library eliminates error-handling boilerplate and ensures CloudFormation receives responses reliably. However, note that maintenance is dormant (654 days since last release); verify compatibility with your Python version and current boto3/CloudFormation APIs before adopting in new projects, and monitor for any security updates.
Install
crhelper on PyPI
pip
pip install crhelperuv
uv add crhelperpoetry
poetry add crhelperInstalling crhelper
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 654 days ago, though the repository remains active with 384 stars and no recent commits.
License in practice
Licensed under Apache 2.0 (permissive), allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install crhelper
from crhelper import CfnResource
helper = CfnResource()
@helper.create
def create(event, context):
helper.Data.update({"key": "value"})
return "ResourceId"
def handler(event, context):
helper(event, context)
Intended for AWS Lambda functions invoked by CloudFormation; requires appropriate IAM permissions if polling is enabled (lambda:AddPermission, events:PutRule, etc.).
Verify before relying
- Whether the package works with Python versions beyond 3.6 and 3.7 (classifiers list only those two, but requires_python is unspecified).
- Current compatibility with recent boto3 versions and CloudFormation API changes since the last release 654 days ago.
Package facts
| License | Apache2 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 654 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 482,836/month — #6,420 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: crhelper-2.0.12-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
aws-cdk.custom-resourcesProvides a framework for implementing AWS…
permissive · top 15,000 on PyPI
cloudformation-cliA command-line tool for authoring and managing…
permissive · top 15,000 on PyPI
cfnresponseSends response objects to AWS CloudFormation…
permissive · top 15,000 on PyPI
cfn-flipConverts AWS CloudFormation templates between…
permissive · top 5,000 on PyPI
awslabs.aws-iac-mcp-serverProvides an MCP server that validates…
permissive · top 15,000 on PyPI
aws-cdk.aws-cloudformationDefines AWS CloudFormation resources…
permissive · top 15,000 on PyPI
kappaKappa is a command-line tool that automates the…
permissive · top 15,000 on PyPI
aws-cdk.cx-apiProvides the cloud executable protocol and…
permissive · top 15,000 on PyPI
aws-cdk.aws-logsProvides AWS CDK constructs for creating and…
permissive · top 15,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI