From 1299bc8f357e18f5e724eee3e298b0cc66e75013 Mon Sep 17 00:00:00 2001 From: Mohamed ElAsmar Date: Sat, 14 Sep 2024 19:45:12 -0700 Subject: [PATCH] update readme --- .../aws-cdk-lib/aws-s3-deployment/README.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/aws-cdk-lib/aws-s3-deployment/README.md b/packages/aws-cdk-lib/aws-s3-deployment/README.md index bf74e108d345f..e196e357fa492 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/README.md +++ b/packages/aws-cdk-lib/aws-s3-deployment/README.md @@ -469,6 +469,26 @@ new cdk.CfnOutput(this, 'ObjectKey', { }); ``` +## Controlling the Output of Source Object Keys + +By default, the keys of the source objects copied to the destination bucket are returned in the Data property of the custom resource. However, you can disable this behavior by setting the outputObjectKeys property to false. This is particularly useful when the number of objects is too large and might exceed the size limit of the data property. + +```ts +import * as cdk from 'aws-cdk-lib'; + +declare const destinationBucket: s3.Bucket; + +const myBucketDeployment = new s3deploy.BucketDeployment(this, 'DeployMeWithoutExtractingFilesOnDestination', { + sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))], + destinationBucket, + outputObjectKeys: false, +}); + +new cdk.CfnOutput(this, 'ObjectKey', { + value: cdk.Fn.select(0, myBucketDeployment.objectKeys), +}); +``` + ## Notes - This library uses an AWS CloudFormation custom resource which is about 10MiB in