Registry / devops / aws-cdk-aws-s3-deployment

aws-cdk-aws-s3-deployment

JSON →
library1.204.0pypypi✓ verified 84d ago

This library provides constructs to deploy contents to S3 buckets, supporting various source types like local files, Docker images, and existing buckets. Version 1.204.0 is part of the AWS CDK v1 (legacy) and receives critical updates only. Users are strongly advised to migrate to AWS CDK v2 (package: aws-cdk-lib).

pip install aws-cdk-aws-s3-deployment==1.204.0
INSTALL
IMPORT
SIG · AWS-CDK-AWS-S3-DEP
A
aws-cdk-aws-s3-deployment
devopspythonv1.204.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

BucketDeployment
from aws_cdk.aws_s3_deployment import BucketDeployment
from aws_cdk.aws_s3_deployment import S3Deployment
S3Deployment is not a valid class; use BucketDeployment.
Source
from aws_cdk.aws_s3_deployment import Source
Source is a helper class, not a deployment construct.

Deploy files from local directory to an S3 bucket.

from aws_cdk import core from aws_cdk.aws_s3 import Bucket from aws_cdk.aws_s3_deployment import BucketDeployment, Source app = core.App() stack = core.Stack(app, "MyStack") bucket = Bucket(stack, "MyBucket") BucketDeployment(stack, "DeployFiles", sources=[Source.asset("./my-files")], destination_bucket=bucket ) app.synth()
Debug
Known issues
breakingCDK v1 is deprecated. New projects should use CDK v2 (aws-cdk-lib). The package aws-cdk-aws-s3-deployment is not compatible with CDK v2.
fix
Migrate to aws-cdk-lib and use from aws_cdk.aws_s3_deployment import BucketDeployment (same import path).
affects: >=1.0.0
gotchaBucketDeployment requires an existing bucket. It will not create one automatically. You must create a Bucket construct separately.
fix
Define a Bucket before BucketDeployment and pass it as destination_bucket.
affects: all
gotchaSource.asset() copies files at synthesis time, not at deployment time. Ensure files exist locally before running cdk deploy.
fix
Run cdk deploy from a directory where the asset path is accessible.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aws_cdk.aws_s3_deployment'
Missing installation of aws-cdk-aws-s3-deployment or using CDK v2 (which includes it in aws-cdk-lib).
fix
Install: pip install aws-cdk-aws-s3-deployment (v1) OR use CDK v2 with pip install aws-cdk-lib.
AttributeError: module 'aws_cdk.aws_s3_deployment' has no attribute 'BucketDeployment'
Using an old version of the library where the class name was different or not exported.
fix
Upgrade to latest version: pip install --upgrade aws-cdk-aws-s3-deployment. In CDK v2, use from aws_cdk.aws_s3_deployment import BucketDeployment.
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk-liboptionalCDK v2 migration alternative
Agent activity
13 hits · last 30 days
node
8
OpenAI (training)
2
Amazon
1
Resources
aws-cdk-aws-s3-deployment — pip install aws-cdk-aws-s3-deployment · libregistry