--- id: crhelper version: "2.0.12" license: Apache2 license_treatment: permissive maintenance: dormant --- # crhelper — crhelper simplifies authoring CloudFormation Custom Resources License: permissive · Maintenance: dormant · Downloads: 482.8K/mo ## 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 above — 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 pip install crhelper uv add crhelper poetry add crhelper ## Installing 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 482.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cloudformation custom resource lambda, cfn custom resource helper, lambda cloudformation integration, custom resource response handler, cloudformation lambda decorator, cfn resource lifecycle management, lambda timeout polling cloudformation, cloudformation, aws-lambda, infrastructure-as-code [View on SkillFed](https://skillfed.io/packages/crhelper) · [View on PyPI](https://pypi.org/project/crhelper/)