skillfed

cfnresponse

Send a response object to a custom resource by way of an Amazon S3 presigned URL

cfnresponse v1.1.5 358.2K downloads/30d#7,265 on PyPI11
Permissive license Active released

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 cfnresponse

uv

uv add cfnresponse

poetry

poetry add cfnresponse

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

cloudformation lambda responsecfn custom resource callbackaws lambda cfnresponsecloudformation stack signallambda custom resource handlercfnresponse modulecloudformation presigned url response
aws-lambdacloudformationinfrastructure-as-code

More Python Modules packages