#13906·serverless

Sandbox packages (zips) are not cleared from deployment bucket as stack dirs are

Author: Hi-FiCreated Sep 28, 2026Updated Sep 28, 2026
Labelsbugcat/packaging

Issue description

When deploying specific stage to account multiple times directory containing custom resources and compiled CloudFormation stacks are pruned by default keeping only 5 latest ones.

This same is not happening with sandbox zip files, but amount of those just increases.

This creates an issue that deployment just silently fails when deployment lists S3 objects on deployment bucket (before removal)

Context

Without any additional deployment bucket or pruning settings, uploaded stack artifacts (compiled-cloudformation-template.json, custom-resources.zip, serverless-state.json) inside date-specific directory (like 1790574585511-2026-09-28T05:49:45.511Z) are removed so that there would be just 5 directories.

Within sandboxes directory similar cleaning is not happening, which then causes deployment silently to fail (probably die NPM running out of memory that's then hidden at some point of processing).