cfnresponse
Send a response object to a custom resource by way of an Amazon S3 presigned URL
What it is and what it does
cfnresponse is a Python module that handles the response protocol for AWS CloudFormation custom resources. When you create a custom resource in CloudFormation backed by a Lambda function, that Lambda needs to signal back to CloudFormation whether the operation succeeded or failed by posting to a presigned S3 URL. This package provides the send() function and response status constants (SUCCESS, FAILED) to handle that communication.
The module is a standalone PyPI package version of code that AWS provides natively in Lambda environments. It depends only on urllib3 for HTTP operations. It's useful for local development, testing, or when you want explicit control over the cfnresponse implementation rather than relying on the built-in Lambda version.
Use it for:
- Local testing of Lambda custom resource handlers before deployment to CloudFormation.
- Explicit control over cfnresponse behavior in Lambda functions handling CloudFormation custom resources.
- Development environments where you need to mock or override the native Lambda cfnresponse module.
- Ensuring version consistency across multiple Lambda functions or deployment pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends response objects to AWS CloudFormation custom resources via S3 presigned URLs, enabling Lambda functions to signal success or failure back to CloudFormation stacks.
Yes, if you are developing or testing AWS CloudFormation custom resources in Lambda and need cfnresponse outside the native Lambda runtime. No, if you only deploy to Lambda—the module is already available there. The package is stable, actively maintained, has no known vulnerabilities, and carries a permissive license.
Install
cfnresponse on PyPI
pip
pip install cfnresponseuv
uv add cfnresponsepoetry
poetry add cfnresponseInstalling cfnresponse
Before you install
Low install friction with a single lightweight dependency (urllib3). Actively maintained with recent commits; last release was 741 days ago but the repository shows ongoing activity.
License in practice
Licensed under Apache Software License (permissive), imposing no significant restrictions on use or redistribution in most contexts.
Quickstart
pip install cfnresponse
import cfnresponse
def handler(event, context):
try:
# Your custom resource logic here
cfnresponse.send(event, context, cfnresponse.SUCCESS, {'key': 'value'})
except Exception as e:
cfnresponse.send(event, context, cfnresponse.FAILED, {})
Designed for AWS Lambda environments; requires CloudFormation custom resource event structure with ResponseURL, StackId, RequestId, and LogicalResourceId fields.
Verify before relying
- Whether this package is necessary outside Lambda (native cfnresponse is built into Lambda runtime).
- Specific use cases for local development or non-Lambda environments where urllib3 would be the primary value-add.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — urllib3 |
| Maintenance | actively maintained — 741 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 358,168/month — #7,265 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cfnresponse-1.1.5-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
aws-cdk.aws-sns-subscriptionsProvides AWS CDK constructs for subscribing SNS…
permissive · top 15,000 on PyPI
crhelperSimplifies writing CloudFormation custom…
permissive · top 15,000 on PyPI
cloudformation-cliA command-line tool for authoring and managing…
permissive · top 15,000 on PyPI
s3urlsParse and build Amazon S3 URLs in multiple…
permissive · top 15,000 on PyPI
aws-sam-translatorTransforms AWS Serverless Application Model…
permissive · top 1,000 on PyPI
botocoreBotocore provides low-level, data-driven access…
permissive · top 100 on PyPI
boto3Boto3 is the official AWS SDK for Python,…
permissive · top 100 on PyPI
s3transfers3transfer manages concurrent uploads and…
permissive · top 100 on PyPI
watchtowerWatchtower is a Python logging handler that…
permissive · top 1,000 on PyPI