Registry / aws / aws-cdk-assets

aws-cdk-assets

JSON →
library1.204.0pypypiunverified

The `aws-cdk-assets` module (v1.x) for the AWS Cloud Development Kit (CDK) is deprecated. Its functionality, primarily for S3 and ECR assets, has been consolidated into specific, dedicated asset modules such as `aws-cdk.aws_s3_assets` and `aws-cdk.aws_ecr_assets` within CDK v1, or `aws_cdk_lib.aws_s3_assets` and `aws_cdk_lib.aws_ecr_assets` for CDK v2. It currently publishes alongside `aws-cdk` v1 releases, but its direct use is strongly discouraged.

pip install aws-cdk-assets
INSTALL
IMPORT
SIG · AWS-CDK-ASSETS
A
aws-cdk-assets
awspythonv1.204.0
Install
8.4s avg
Import
Disk
555MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.960 runs
installs and imports cleanly · install 0.0s · import 0.000s · 479.7MB
glibc
py 3.103.960 runs
installs and imports cleanly · install 8.4s · import 0.000s · 551MB
555MB installed
● package 555MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Asset
from aws_cdk.aws_s3_assets import Asset
from aws_cdk.aws_s3_assets import Asset

This quickstart demonstrates how to use the recommended pattern for S3 assets within AWS CDK (v2+). Instead of `aws-cdk-assets`, you directly import and use `aws_s3_assets` from the `aws-cdk-lib` package. For CDK v1, replace `aws_cdk_lib` with `aws_cdk` and ensure you `pip install aws-cdk.aws-s3-assets`.

import os from aws_cdk import ( # aws-cdk-lib for v2 App, Stack, aws_s3_assets as s3_assets, aws_s3 as s3 ) class MyAssetStack(Stack): def __init__(self, scope: App, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) # Create a dummy directory for the asset asset_dir = 'my-asset-content' os.makedirs(asset_dir, exist_ok=True) with open(os.path.join(asset_dir, 'hello.txt'), 'w') as f: f.write('Hello, CDK Assets!') # Define an S3 Asset (CDK v2 example) my_asset = s3_assets.Asset(self, 'MyFileAsset', path=asset_dir ) # Create an S3 Bucket and grant read access to the asset bucket = s3.Bucket(self, 'MyBucket', versioned=True # Assets can be versioned ) # Output the asset S3 path self.asset_s3_url = my_asset.s3_object_url print(f"Asset S3 URL: {self.asset_s3_url}") # Clean up dummy directory (optional) # import shutil # shutil.rmtree(asset_dir) if __name__ == '__main__': app = App() stack = MyAssetStack(app, 'MyAssetStackExample') # Uncomment to synthesize for deployment # app.synth()
Debug
Known issues
breakingThe `aws-cdk-assets` package is deprecated and should not be used. Its constructs are no longer maintained or actively developed under this specific package name.
fix
Migrate to dedicated asset modules: `aws_cdk.aws_s3_assets` / `aws_cdk.aws_ecr_assets` for CDK v1, or `aws_cdk_lib.aws_s3_assets` / `aws_cdk_lib.aws_ecr_assets` for CDK v2.
affects: All versions (especially from CDK v1.x onwards and completely in v2+)
gotchaAttempting to use `from aws_cdk.aws_cdk_assets import Asset` or similar imports will result in `ModuleNotFoundError` or `AttributeError` when using `aws-cdk-lib` (CDK v2) or recent versions of `aws-cdk.core` (CDK v1).
fix
Update your imports to use `from aws_cdk_lib import aws_s3_assets` (CDK v2) or `from aws_cdk import aws_s3_assets` (CDK v1) and ensure `aws-cdk-lib` or `aws-cdk.aws-s3-assets` is installed.
affects: CDK v1.x (newer releases) and all CDK v2.x
deprecatedEven though `aws-cdk-assets` might still be installable for legacy reasons, its API is no longer part of the standard `aws-cdk` or `aws-cdk-lib` structure, leading to compatibility issues.
fix
Refactor your CDK code to use the modern asset handling patterns provided directly by `aws-cdk-lib` (v2) or specific `aws-cdk.<service-name>-assets` modules (v1).
affects: All versions of `aws-cdk-assets`
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
OpenAI (training)
1
Resources
aws-cdk-assets — pip install aws-cdk-assets · libregistry