The reason for this is when create a lambda dependency layer you have no reason to copy in files. To avoid copying in files I had to create an empty directory.
code=Code.from_asset('empty',
bundling=BundlingOptions(
image=Runtime.PYTHON_3_11.bundling_image,
# Must follow this file structure
# https://docs.aws.amazon.com/lambda/latest/dg/python-layers.html
command=["bash", "-c", "pip install pygeohash==1.2.0 -t /asset-output/python/"]
Proposed Solution
Either create a more specific Code.from_bundle or make the path argument optional.
Other Information
No response
Acknowledgements
[ ] I may be able to implement this feature request
Describe the feature
Make Code.from_asset first argument optional.
Use Case
The reason for this is when create a lambda dependency layer you have no reason to copy in files. To avoid copying in files I had to create an empty directory.
Proposed Solution
Either create a more specific Code.from_bundle or make the path argument optional.
Other Information
No response
Acknowledgements
CDK version used
2.142.1 (build ed4e152)
Environment details (OS name and version, etc.)
Ubuntu 22.04, Python3.11