Skip to content

Commit

Permalink
feat(s3-deployment): added property outputObjectKeys for BucketDeploy…
Browse files Browse the repository at this point in the history
…ment (#31452)

### Issue # (if applicable)

Closes #28579

### Reason for this change

The [CR lambda](https://github.com/aws/aws-cdk/blob/597228c1552a21f8dc7250a0be62160f838bb776/packages/%40aws-cdk/custom-resource-handlers/lib/aws-s3-deployment/bucket-deployment-handler/index.py#L138C14-L138C30) is essentially sending back the same data in the response which is hitting the limit for close to 50 object uploads.

Particularly this is being a limitation when using servicecatalog.ProductStack, if there are local assets beyond a particular number, the Custom::CDKBucketDeployment would fail with the error Response object is too long which is a hard limit of 4096 bytes.

### Description of changes

1. Added a new property to control the custom resource sending large data and hitting the 4096 bytes limit even though the deployment operation is successful. 
2. The property `outputObjectKeys` has been set to false by default for the service catalog product so that the error does not occur. 

### Description of how you validated changes

Validated using a sample stack with the property set and confirmed the behavior. Also, the existing deployments would be unaffected. 

### 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*
  • Loading branch information
moelasmar authored Sep 27, 2024
1 parent 8318e79 commit 54c01cb
Show file tree
Hide file tree
Showing 308 changed files with 118,863 additions and 80,153 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Currently, this repository has LF dependencies in building and testing, with json, sh, and no extensions.
# Until this is fixed, it is best to just set the whole repository to be LF.
* eol=lf

*.gif binary
*.zip binary
*.png binary
*.jpg binary
*.tgz binary
*.tar.gz binary

# Hide snapshots from GitHub UI, except for the actual templates
**/*.snapshot/** linguist-generated
**/*.snapshot/**/*.template.json -linguist-generated
**/*.snapshot/**/*DeployAssert*.template.json linguist-generated
packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-big-response.js.snapshot/asset.3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip filter=lfs diff=lfs merge=lfs -text

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,8 @@
"Ref": "MyBucketF68F3FF0"
},
"RetainOnDelete": false,
"Prune": true
"Prune": true,
"OutputObjectKeys": true
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -917,7 +918,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "0158f40002a8c211635388a87874fd4dcc3d68f525fe08a0fe0f014069ae539c.zip"
"S3Key": "c6358465bf49dfae556bb430bf9c81fa578c221b82c308e3707901b1dd654762.zip"
},
"Environment": {
"Variables": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 54c01cb

Please sign in to comment.