diff --git a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts index d10bfb249fed0..cd32d6017be51 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts @@ -32,9 +32,12 @@ export interface BucketDeploymentProps { readonly destinationBucket: s3.IBucket; /** - * Key prefix in the destination bucket. + * Key prefix in the destination bucket. Must be <=104 characters * - * Must be <=104 characters + * If it's set with prune: true, it will only prune files with the prefix. + * + * We recommend to always configure the `destinationKeyPrefix` property. This will prevent the deployment + * from accidentally deleting data that wasn't uploaded by it. * * @default "/" (unzip to root of the destination bucket) */ @@ -71,6 +74,9 @@ export interface BucketDeploymentProps { readonly include?: string[]; /** + * By default, files in the destination bucket that don't exist in the source will be deleted + * when the BucketDeployment resource is created or updated. + * * If this is set to false, files in the destination bucket that * do not exist in the asset, will NOT be deleted during deployment (create/update). *