Skip to content

core: support specifying included files for Code.from_asset #26107

Open
@rittneje

Description

@rittneje

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 in Code.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

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

CDK version used

2.85.0

Environment details (OS name and version, etc.)

Alpine 3.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-lambdaRelated to AWS Lambdaeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions