A deploy in one of my CDK projects passed every gate I have — CI, cdk synth, code review — and merged. The CloudFormation stack deployment to AWS failed with:
InvalidRequest: Unzipped size must be smaller
than 262144000 bytes
262,144,000 bytes is 250 MiB, AWS's hard limit on the unzipped deployment package of a zip-packaged Lambda. A few transitive dependencies had crept in and pushed one function's bundle over the edge.
It failed in an uncomfortable place. cdk synth builds the CloudFormation template and stages every Lambda's code asset under cdk.out/asset.<hash>/, but it never weighs the unzipped size of what it staged. AWS enforces unzipped size at deploy time, and nothing in the pipeline measured it. Synth, review, and merge were all blind to it, and the failure surfaced only after everything that was supposed to catch problems had already said fine.