skillfed

aws-cdk.aws-s3-assets

Deploy local files and directories to S3

aws-cdk-aws-s3-assets v1.204.0 184.8K downloads/30d#10,024 on PyPI12,868
Permissive license Apache-2.0 Active released

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-assets

uv

uv add aws-cdk-aws-s3-assets

poetry

poetry add aws-cdk-aws-s3-assets

Installing 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

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

aws cdk s3 asset deploymentlocal file packaging for awscdk asset bundlings3 asset managementcloudformation asset parameterslambda code packaging awsdocker bundling for cdk
aws-cdkinfrastructure-as-codeend-of-life

More Build Tools packages

packaging

Provides reusable utilities for Python…

permissive · top 100 on PyPI

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

pip

pip is the standard installer for Python…

permissive · top 100 on PyPI

hatchling

Hatchling is a standards-compliant Python build…

permissive · top 100 on PyPI

grpcio-tools

Generates Python gRPC service stubs and message…

permissive · top 1,000 on PyPI

pre-commit

pre-commit is a framework for installing and…

permissive · top 1,000 on PyPI

aws-cdk.aws-ecr-assets

Bundles Docker images as AWS CDK assets,…

permissive · top 15,000 on PyPI

aws-cdk.aws-s3-deployment

Deploys files and directories to AWS S3 buckets…

permissive · top 15,000 on PyPI

aws-cdk.asset-awscli-v1

Bundles AWS CLI v1 as a reusable asset for AWS…

permissive · top 5,000 on PyPI

aws-cdk.asset-node-proxy-agent-v6

Bundles the NPM proxy-agent package (version…

permissive · top 5,000 on PyPI

aws-cdk.asset-node-proxy-agent-v5

Bundles the NPM proxy-agent package as an AWS…

permissive · top 15,000 on PyPI

aws-cdk.integ-tests-alpha

Provides constructs and utilities for writing…

permissive · top 15,000 on PyPI

cdk-ecr-deployment

A CDK construct that copies Docker images…

permissive · top 15,000 on PyPI

aws-cdk.aws-lambda-python-alpha

Provides AWS CDK constructs for defining,…

permissive · top 5,000 on PyPI

aws-cdk.aws-imagebuilder

Provides AWS CDK L1 constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.region-info

Provides a queryable database of AWS…

permissive · top 15,000 on PyPI