aws-cdk.aws-s3-assets
Deploy local files and directories to S3
What it is and what it does
aws-cdk.aws-s3-assets is a component of AWS CDK v1 that automates the packaging and deployment of local files and directories to S3 during CDK stack synthesis. When you define an Asset construct pointing to a local path, the toolkit automatically archives the content (if it's a directory), calculates an MD5 hash, uploads it to an environment-specific S3 bucket, and injects the S3 location as CloudFormation parameters into your stacks. This is commonly used to bundle Lambda function code, static assets, or any artifact needed by your infrastructure.
The package supports optional Docker-based bundling for preprocessing assets before upload—for example, compiling code, converting file formats, or installing dependencies. You can also implement local bundling providers to avoid Docker overhead. Assets expose deploy-time attributes like bucket name, object key, and HTTP URL that can be referenced in your stack outputs or passed to other constructs. The package integrates deeply with CDK's synthesis and deployment pipeline, handling asset versioning and deduplication transparently.
Use it for:
- Package Lambda function handler code and dependencies into a zip file for upload to S3 during CDK deployment
- Bundle static web assets or configuration files and inject their S3 URLs into CloudFormation stacks
- Use Docker containers to preprocess assets (e.g., compile TypeScript, minify CSS) before uploading to S3
- Grant IAM roles read permissions on deployed assets using the grantRead() method for runtime access
- Export asset S3 locations as stack outputs for reference by other stacks or external tools
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Packages local files and directories for deployment to S3 as part of AWS CDK applications, handling asset bundling, hashing, and CloudFormation parameter injection.
No—this package is part of AWS CDK v1, which reached End-of-Support on 2023-06-01 and is no longer being updated. AWS explicitly recommends migrating to AWS CDK v2. Install only if maintaining legacy v1 infrastructure; for new projects or migrations, use the v2 equivalent instead.
Install
aws-cdk-aws-s3-assets on PyPI
pip
pip install aws-cdk-aws-s3-assetsuv
uv add aws-cdk-aws-s3-assetspoetry
poetry add aws-cdk-aws-s3-assetsInstalling aws-cdk.aws-s3-assets
Before you install
Low friction installation with 10 runtime dependencies. Package is in active maintenance status but reached End-of-Support on 2023-06-01; AWS CDK v1 is no longer being updated and users should migrate to AWS CDK v2.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions.
Quickstart
from aws_cdk import aws_s3_assets as assets
import os
asset = assets.Asset(None, "SampleAsset",
path=os.path.join(os.path.dirname(__file__), "sample-asset-directory")
)
print(asset.s3_bucket_name)
print(asset.s3_object_key)
Requires AWS CDK core and construct libraries to be installed; asset bundling with Docker requires Docker to be available or a local bundling provider to be implemented.
Verify before relying
- Whether v1 packages continue to receive security patches despite End-of-Support status
- Migration path complexity and effort for existing v1 applications moving to v2
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (~=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — aws-cdk.assets, aws-cdk.aws-iam, aws-cdk.aws-kms, aws-cdk.aws-s3, aws-cdk.core, aws-cdk.cx-api, constructs, jsii, publication, typeguard |
| Maintenance | actively maintained — 1,152 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 184,821/month — #10,024 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_cdk.aws_s3_assets-1.204.0-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
aws-cdk.aws-ecr-assetsBundles Docker images as AWS CDK assets,…
permissive · top 15,000 on PyPI
aws-cdk.aws-s3-deploymentDeploys files and directories to AWS S3 buckets…
permissive · top 15,000 on PyPI
aws-cdk.asset-awscli-v1Bundles AWS CLI v1 as a reusable asset for AWS…
permissive · top 5,000 on PyPI
aws-cdk.asset-node-proxy-agent-v6Bundles the NPM proxy-agent package (version…
permissive · top 5,000 on PyPI
aws-cdk.asset-node-proxy-agent-v5Bundles the NPM proxy-agent package as an AWS…
permissive · top 15,000 on PyPI
aws-cdk.integ-tests-alphaProvides constructs and utilities for writing…
permissive · top 15,000 on PyPI
cdk-ecr-deploymentA CDK construct that copies Docker images…
permissive · top 15,000 on PyPI
aws-cdk.aws-lambda-python-alphaProvides AWS CDK constructs for defining,…
permissive · top 5,000 on PyPI
aws-cdk.aws-imagebuilderProvides AWS CDK L1 constructs for defining and…
permissive · top 15,000 on PyPI
aws-cdk.region-infoProvides a queryable database of AWS…
permissive · top 15,000 on PyPI