skillfed

aws-cdk.custom-resources

Constructs for implementing CDK custom resources

aws-cdk-custom-resources v1.204.0 155.3K downloads/30d#10,824 on PyPI12,868
Permissive license Apache-2.0 Active released

What it is and what it does

This package provides a Provider construct that acts as a mini-framework for building AWS CloudFormation custom resources within AWS CDK. It wraps Lambda functions as handlers for CloudFormation lifecycle events (Create, Update, Delete), managing the request/response protocol, error handling, and response submission back to CloudFormation. The framework supports both synchronous handlers (onEvent) that complete immediately and asynchronous handlers (isComplete) that poll until a resource reaches a stable state, useful for operations exceeding Lambda's timeout window.

The package depends on aws-cdk.core, aws-cdk.aws-lambda, aws-cdk.aws-iam, aws-cdk.aws-logs, and several other CDK modules to construct and manage the underlying infrastructure. However, it is important to note that AWS CDK v1 reached end-of-support on 2023-06-01, and this package is no longer being updated. Users should plan migration to AWS CDK v2 rather than starting new projects with this version.

Use it for:

  • Implement a custom CloudFormation resource that provisions third-party infrastructure not natively supported by CloudFormation.
  • Create a long-running provisioning operation (e.g., database initialization) that requires polling until completion rather than immediate return.
  • Build a wrapper around an external API to make it deployable as a CloudFormation custom resource within CDK stacks.
  • Handle resource lifecycle events (creation, updates, deletion) with custom business logic before or after standard AWS operations.
  • Validate and transform resource properties during CloudFormation deployment using Lambda-based custom logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a framework for implementing AWS CloudFormation custom resources using AWS CDK, handling lifecycle events and asynchronous operations through Lambda functions.

No — do not install for new projects. This package is end-of-support (AWS CDK v1 reached end-of-support 2023-06-01) and users are explicitly directed to migrate to AWS CDK v2. Only use if maintaining an existing CDK v1 codebase with no migration path; otherwise, adopt the v2 equivalent to receive updates and security patches.

Install

aws-cdk-custom-resources on PyPI

pip

pip install aws-cdk-custom-resources

uv

uv add aws-cdk-custom-resources

poetry

poetry add aws-cdk-custom-resources

Installing aws-cdk.custom-resources

Before you install

Low install friction with 11 runtime dependencies. Package is in active maintenance but marked as inactive (Development Status 7) — AWS CDK v1 reached end-of-support on 2023-06-01 and users are advised to migrate to AWS CDK v2.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

from aws_cdk import custom_resources as cr
from aws_cdk import aws_lambda as lambda_
from aws_cdk import aws_iam as iam
from aws_cdk import aws_logs as logs

provider = cr.Provider(self, "MyProvider",
    on_event_handler=on_event_function,
    is_complete_handler=is_complete_function,
    log_retention=logs.RetentionDays.ONE_DAY,
    role=my_role
)

Requires AWS CDK v1 runtime environment; package is end-of-support as of 2023-06-01 and migration to AWS CDK v2 is recommended.

Verify before relying

  • Whether AWS CDK v2 has a direct replacement for this custom resources module or if migration requires architectural changes.
  • Performance characteristics and timeout limits for asynchronous handlers under typical workloads.
  • Security implications of Step Functions execution history exposure mentioned in the description for your threat model.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (~=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 11 — aws-cdk.aws-cloudformation, aws-cdk.aws-ec2, aws-cdk.aws-iam, aws-cdk.aws-lambda, aws-cdk.aws-logs, aws-cdk.aws-sns, aws-cdk.core, constructs, jsii, publication, typeguard
Maintenance actively maintained — 1,152 days since the last release
Last repo commit
First released
Downloads 155,328/month — #10,824 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aws_cdk.custom_resources-1.204.0-py3-none-any.whl

Development Status :: 7 - InactiveFramework :: AWS CDKFramework :: AWS CDK :: 1Intended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

cloudformation custom resourcesaws cdk custom resourcescdk provider frameworklambda cloudformation integrationcdk lifecycle handlerscustom resource provisioningasynchronous resource handlers
aws-cdkcloudformationend-of-support

More Build Tools packages