Skip to content

🚀 Feature Request: Option to disable ZIP compression for faster Lambda packaging #410

@mungojam

Description

@mungojam

Describe the feature

Packaging Lambda functions with the AWS Extensions for .NET CLI currently uses Deflate ZIP compression, which can significantly slow down build times, particularly for large projects or in CI/CD workflows. Since AWS Lambda unpacks zipped archives upon deployment, the benefit of compression is mainly in transit, and build time is the primary concern for developers. An option to disable ZIP compression—using "store only"—would allow for much faster package creation with minimal trade-off for most users.

Use Case

Developers or CI/CD pipelines working with large Lambda deployments face long wait times due to compression, while upload size is rarely the bottleneck. This option helps speed up rapid iteration, making the build process more productive and responsive.

Proposed Solution

  • Add a CLI option (--disable-zip-compression) to the packaging commands.
  • In the Go zip utility (build-lambda-zip.go), add a flag that chooses zip.Store instead of zip.Deflate.
  • Update C# methods in LambdaPackager.cs and CLI wrappers to thread the compression flag and pass it to the native zip CLI (-0 flag) and Go utility, as needed.
  • Document clearly in helptext and CLI output.
  • Default to current behavior unless the user opts in.

Other Information

Other Information

Relevant code files for maintainers:

  • src/Amazon.Lambda.Tools/BuildLambdaZip/build-lambda-zip.go
  • src/Amazon.Lambda.Tools/LambdaPackager.cs
  • src/Amazon.Common. DotNetCli.Tools/Utilities.cs
  • Command option definitions and parser updates (LambdaDefinedCommandOptions. cs and relevant command classes)

This feature is opt-in; backwards compatible

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Targeted .NET platform

Any modern .NET version supported by the tool (.NET Core 3.1, .NET 6, .NET 8, etc.)

CLI extension version

5.13.2

Environment details (OS name and version, etc.)

All major platforms: Windows, Linux, macOS, Amazon Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions