Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

aws_lambda: Code.from_asset requires string as the first argument. #30457

Open
2 tasks
InvincibleRMC opened this issue Jun 5, 2024 · 1 comment
Open
2 tasks
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@InvincibleRMC
Copy link

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.

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
  • This feature might incur a breaking change

CDK version used

2.142.1 (build ed4e152)

Environment details (OS name and version, etc.)

Ubuntu 22.04, Python3.11

@InvincibleRMC InvincibleRMC added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 5, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Jun 5, 2024
@pahud
Copy link
Contributor

pahud commented Jun 7, 2024

Yeah, this makes sense to me. Thank you for the report and we welcome the pull requests.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants