-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
‼️ (aws-lambda-python): SAM - CDK integration is broken in CDK V2.4.0 #18301
Comments
This issue also exist in CDK versions 1.137.0 and 1.138.0 |
I believe the issue here
|
Thanks for reporting this. We have reproduced and are working on a patch, and a release to fix the issue. For v2 users, you can remain on |
Thanks @njlynch .. This issue also exist in versions 1.137.0, and 1.138.0. Are you going to release a fix for these versions as well? |
|
Pending release for v2. |
I might be doing something wrong, but I get the synth failures due to the issue above on 1.138.0 and 1.138.1 (python cdk). 1.137.0 works correctly.
|
…' folder (#18306) Changes the asset structure from: ``` ├── asset.993168cfa75b295eeea55bf603340284b9be46ebc079e4965f2c16f5470efda5 │ └── asset-input │ ├── __init__.py │ └── app.py ``` to: ``` ├── asset.993168cfa75b295eeea55bf603340284b9be46ebc079e4965f2c16f5470efda5 │ ├── __init__.py │ └── app.py ``` Fixes #18301. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* (cherry picked from commit aff607a)
See also this comment from @chrispykim: #18082 (comment)
|
Asset files are incorrectly being bundled under the `asset-input` directory instead of the root of the bundle. To also copy over hidden files (#18306 (comment)), I switched from using `-R` to `-a` based on what I found on [SO](https://stackoverflow.com/a/13020113) and the [man page](https://linux.die.net/man/1/cp). (`-a` is equivalent to `-dR`.) Fixes #18301 and @chrispykim's comment: #18082 (comment). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
@otaviomacedo can you confirm this is fix causes python lambdas to work as expected in |
@raincoastchris thanks for calling this out mergify closed the issue automatically. I'm reopening, as the actual fix will be available in the next release. |
This is resolved for me in https://github.com/aws/aws-cdk/releases/tag/v1.139.0. |
|
This is still an issue on CDK Python since it's still creating the asset directory and lambda is unable to find the handler. The workaround was to stay on 2.3.0-alpha.0 as stated by @njlynch : aws-cdk.aws-lambda-python-alpha==2.3.0a0 |
@Z11 : Interesting. I just used v1.140.0 with TypeScript and it worked fine, so this might be a CDK Python-specific issue. Makes me wonder if there's something with the JSII interpretation / transpilation. |
Currently working with the following: |
@corymhall can you reopen this? It's still an issue. |
…' folder (aws#18306) Changes the asset structure from: ``` ├── asset.993168cfa75b295eeea55bf603340284b9be46ebc079e4965f2c16f5470efda5 │ └── asset-input │ ├── __init__.py │ └── app.py ``` to: ``` ├── asset.993168cfa75b295eeea55bf603340284b9be46ebc079e4965f2c16f5470efda5 │ ├── __init__.py │ └── app.py ``` Fixes aws#18301. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Asset files are incorrectly being bundled under the `asset-input` directory instead of the root of the bundle. To also copy over hidden files (aws#18306 (comment)), I switched from using `-R` to `-a` based on what I found on [SO](https://stackoverflow.com/a/13020113) and the [man page](https://linux.die.net/man/1/cp). (`-a` is equivalent to `-dR`.) Fixes aws#18301 and @chrispykim's comment: aws#18082 (comment). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@corymhall I am having this issue currently, with aws-cdk-lib: 2.40.0 and aws-cdk/aws-lambda-python-alpha:2.40.0a0 (typescript stack with a lambdaPython). |
What is the problem?
There is a new change in CDK Version 2.4.0 that makes the bundled assets to be created under the folder structure as following:
The issue is SAM expects to get the asset location in metadata property
aws:asset:path
, so SAM can read the Lambda Function source code, so the customers can do local testing, but in the new Version, the value of the added metadata is the path till the Asset root directory (till the ), although it should be (/asset-input)For an application that contains a PythonFunction, This is the directory structure after running
cdk synth
using version 2.4.0and this is the synthesized template:
and this is the output in case of using CDK version 2.3.0
and this is the synthesized template:
Reproduction Steps
cdk synth
What did you expect to happen?
The value of the added
aws:asset:path
metadata property should be the location of the source code of the bundled assets.What actually happened?
The value of the added
aws:asset:path
metadata property is the root asset directory.CDK CLI Version
2.4.0
Framework Version
No response
Node.js Version
v14.15.4
OS
mac os
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: