Skip to content

Commit ae29bb5

Browse files
authored
chore(s3): add more details to prune and destinationKeyPrefix property (#32011)
### Reason for this change `prune` and `destinationKeyPrefix` properties documentation is not super clear for users. Adding more details to behaviors when setting/unsetting the property. ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 090c7be commit ae29bb5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ export interface BucketDeploymentProps {
3232
readonly destinationBucket: s3.IBucket;
3333

3434
/**
35-
* Key prefix in the destination bucket.
35+
* Key prefix in the destination bucket. Must be <=104 characters
3636
*
37-
* Must be <=104 characters
37+
* If it's set with prune: true, it will only prune files with the prefix.
38+
*
39+
* We recommend to always configure the `destinationKeyPrefix` property. This will prevent the deployment
40+
* from accidentally deleting data that wasn't uploaded by it.
3841
*
3942
* @default "/" (unzip to root of the destination bucket)
4043
*/
@@ -71,6 +74,9 @@ export interface BucketDeploymentProps {
7174
readonly include?: string[];
7275

7376
/**
77+
* By default, files in the destination bucket that don't exist in the source will be deleted
78+
* when the BucketDeployment resource is created or updated.
79+
*
7480
* If this is set to false, files in the destination bucket that
7581
* do not exist in the asset, will NOT be deleted during deployment (create/update).
7682
*

0 commit comments

Comments
 (0)