-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(lambda-python): PythonFunction index/handler logic broken if handler in subdirectory #15391
Comments
Workaround:
Solution is as described above: do string substitution to replace |
Thank you, I didn't know that trick on using the Cfn property override. |
@ewahl-al Could you explain why or point to documentation that shows that the handler should be using dot notation? Do you receive an error? |
If the lambda function is deployed with the handler path that contains a slash like |
The Python handler name is not a file or a simple top-level name inside the file on the lambda. It is an importable object. It could even make sense for it to be inside a layer. Checking that the handler is a file or anything to that effect is an unnecessary restriction over what AWS Lambda Python runtimes allow outside CDK. |
…mage (#18082) This refactors the bundling process to match the NodeJs and Go Lambda functions and allows providing a custom bundling docker image. Changes: - refactor bundling to use `cdk.BundlingOptions` - Use updated `Bundling` class - Update tests to use updated `Bundling` class Fixes #10298, #12949, #15391, #16234, #15306 BREAKING CHANGE: `assetHashType` and `assetHash` properties moved to new `bundling` property. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
#18082 should have fixed this. We replaced parsing of the handler there for subdirectories.
|
|
…mage (aws#18082) This refactors the bundling process to match the NodeJs and Go Lambda functions and allows providing a custom bundling docker image. Changes: - refactor bundling to use `cdk.BundlingOptions` - Use updated `Bundling` class - Update tests to use updated `Bundling` class Fixes aws#10298, aws#12949, aws#15391, aws#16234, aws#15306 BREAKING CHANGE: `assetHashType` and `assetHash` properties moved to new `bundling` property. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
If a handler function is located in a subdirectory of the lambda code package, the aws_lambda.Function handler property is set to an incorrect value by this line of code in aws-lambda-python/lib/function.ts:
Reproduction Steps
What did you expect to happen?
A lambda function should be deployed with the handler property set to
handlers.my_handler.handle_lambda
What actually happened?
A lambda function was deployed with the handler property set to
handlers/my_handler.handle_lambda
Environment
Other
The index.slice string substitution should replace
/
characters with.
characters.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: