Open rittneje opened 1 year ago
Thank you for your report. I believe the local bundling is still very experimental and we appreciate any PR to improve that.
@pahud if it’s experimental, will breaking changes to the ILocalBundling interface be accepted to make it usable?
@pahud
I second the concerns of @rittneje - this functionality has been available in this non-working state for quite some time without a crumb of documentation alluding to the fact it's experimental or that there are known limitations or issues. Short of fixing this functionality, it would be great to see any mention of these issues in the documentation.
Describe the bug
aws_cdk.BundlingOptions has a property
local
that we can use to define a "local" bundler instead of routing through docker. However, it is broken.First, the Python docs show the completely wrong signature for
ILocalBundling.try_bundle
:In reality, the signature needs to be the same as in TypeScript:
Even after getting through that issue, it seems that the local bundling concept was not designed properly. None of the input parameters tell you what you are intending to bundle. With docker I believe that comes through as the working directory, but the local bundler gets nothing. The working directory (at least on the Python side) is not changed, and there is no parameter for it either. So essentially the only way to do it is to make a separate bundler instance for each
aws_lambda.Code.from_asset
invocation, and duplicate the path in its constructor. It is also unclear to me how any of this is intended to work with theexclude
andfollow_symlinks
parameters since they don't come through either.I will also point out the documentation around local bundling is extremely inadequate. https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_s3_assets/README.html#asset-bundling
Expected Behavior
The Python docs should be accurate. The local bundling feature should be properly designed and tested, with relevant documentation available.
Current Behavior
Does not work in any reasonable sense.
Reproduction Steps
Try to use it.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.85.0 (build 4e0d726)
Framework Version
No response
Node.js Version
v18.16.1
OS
Alpine 3.18
Language
Python
Language Version
Python 3.11.4
Other information
No response