aws / aws/aws-cdk

core: configurable ZIP compression level

Open
#22,427 3 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/core effort/small feature-request good first issue p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

I noticed that the ZIP files produced by CDK are quite a bit larger than those produced, for example, by the "Compress" functionality in macOS Finder for the same content.

The feature request is that the compression level of zlib used in the ZIP compression is made configurable by the user (a speed vs compression ratio trade-off). This could be beneficial, for example, to produce as small packages as possible for Lambda functions.

### Use Case

ZIP files produced as CDK assets (e.g., bundled JS Lambda code/sourcemaps) are larger than they could be.

### Proposed Solution

Expose the `level` setting of `zlib`, which is exposed by the `archiver` library which seems to be used by CDK for ZIP packages (see https://www.npmjs.com/package/archiver)

### Other Information

_No response_

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.43.1

### Environment details (OS name and version, etc.)

macOS 12.5.1

Contributor guide

Open the contributing guide

Research direction

The issue identifies CDK asset ZIP creation and archiver's zlib `level` option as the entry points. Start by tracing the asset packaging path to where archiver is configured; done means users can select the compression level and asset ZIPs use that setting, with existing packaging behavior preserved by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cloud, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.