You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm exploring the use of Nix as a universal option for bundling Lambda code in CDK. Compared to the current approach, which relies on Docker with ad-hoc bundling options, Nix allows for more fine-grained control over dependencies and a reproducible environment.
When introducing a new option for a build tool or adding support for a different bundling tool, the CDK team must evaluate how this change affects existing users, ensuring compatibility and stability. This includes extensive testing of various bundling option combinations and potentially preparing a new Docker image. That can be a time-consuming process.
Currently, the available escape hatch is to provide a custom Docker image, often requiring you to build your own image and include some shell scripts. By using Nix, these challenges are significantly reduced, as it eliminates the need for prebuilt Docker images and simplifies dependency management. Furthermore, when a build runs on a host machine with Nix installed, it takes advantage of Nix's excellent caching capabilities, leading to improved performance.
I’ve put together a POC along with some examples here:
I’d love to hear your thoughts on this approach! If there are any Nix experts here, I’d appreciate any insights or potential concerns regarding its use.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi community,
I'm exploring the use of Nix as a universal option for bundling Lambda code in CDK. Compared to the current approach, which relies on Docker with ad-hoc bundling options, Nix allows for more fine-grained control over dependencies and a reproducible environment.
When introducing a new option for a build tool or adding support for a different bundling tool, the CDK team must evaluate how this change affects existing users, ensuring compatibility and stability. This includes extensive testing of various bundling option combinations and potentially preparing a new Docker image. That can be a time-consuming process.
Currently, the available escape hatch is to provide a custom Docker image, often requiring you to build your own image and include some shell scripts. By using Nix, these challenges are significantly reduced, as it eliminates the need for prebuilt Docker images and simplifies dependency management. Furthermore, when a build runs on a host machine with Nix installed, it takes advantage of Nix's excellent caching capabilities, leading to improved performance.
I’ve put together a POC along with some examples here:
I’d love to hear your thoughts on this approach! If there are any Nix experts here, I’d appreciate any insights or potential concerns regarding its use.
Beta Was this translation helpful? Give feedback.
All reactions