Open rittneje opened 1 year ago
Thanks for your use case sharing.
@pahud
Hi, Pahud!
I have a question for you on this issue.
This issue's title is about aws_lambda
, but the actual asset processing is done in the core
module, so I think it should be done in core
, what do you think?
Specifically, I am thinking of the following approach.
include
parameter to interface FileOptions with exclude
.include
along with ignores
(actually exclude
) in copyDirectory, where the actual file search is done.I haven't submitted a PR yet, but I've implemented it as a trial. I'll let you know what you think and make a decision.
https://github.com/aws/aws-cdk/compare/main...go-to-k:aws-cdk:feat/fs-copy-include-files
@go-to-k Yes this sounds like a good idea! Feel free to submit your PR draft for that, the maintainers would be happy to review your PR.
@pahud
Thank you! I will submit PR!
It was mentioned that the exclude
property with a negation pattern could be used instead of using the include
property, so the PR was closed.
https://github.com/aws/aws-cdk/pull/26365#issuecomment-1646054082
Describe the feature
Add a property to
Code.from_asset
to indicate which particular files within the path should be included. If this property is present, only files matching the pattern will be considered. It is an error to specify this property if the path does not describe a directory.Use Case
We have a bunch of Go lambda functions in one repository. We can easily compile multiple of them in parallel with
go build -o $DIR my-module/cmd/...
. However, this places all the binaries together in one directory. We would like to be able to reference this directory inCode.from_assets
and filter it to only the particular binary name that goes with the Lambda function in question.Currently we have to manually arrange for each binary to be in its own folder, which is really annoying.
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.85.0
Environment details (OS name and version, etc.)
Alpine 3.18