-
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
‼️ NOTICE: aws:asset:original-path
is non deterministic
#17706
Comments
aws:asset:original-path
depends on the executor in Function constructaws:asset:original-path
would frequently be the different value in Function construct
aws:asset:original-path
would frequently be the different value in Function constructaws:asset:original-path
uses wrong path
Thanks for the thorough report @issei-m Before this gets fixed up, you can override your function's metadata with the use of escape hatches @rix0rrr pinging for visibility |
Another workaround might be |
Just FYI, if you deploy via CodeBuild with CodePipeline, this causes re-deployment because the paths change on every CodeBuild. |
For workaround - |
@moelasmar we need to revise #17591 so that |
@peterwoodworth I am tagging this as P0 since it's breaking customers. |
aws:asset:original-path
uses wrong pathaws:asset:original-path
is non deterministic
aws:asset:original-path
is non deterministicaws:asset:original-path
is non deterministic
aws:asset:original-path
is non deterministicaws:asset:original-path
is non deterministic
aws:asset:original-path
is non deterministicaws:asset:original-path
is non deterministic
aws:asset:original-path
is non deterministicaws:asset:original-path
is non deterministic
Revert `aws:asset:original-path` to fix #17706
|
I have the same issue even for lambdas, created by CDK itself (e.g. for S3 deployment).
|
@Dreamescaper are you using v1.135.0? |
@eladb |
Okay that makes sense because we haven't propagated this change into the v2 branch yet. |
Revert `aws:asset:original-path` to fix aws#17706
@eladb when will this fix be added to v2? |
Actually, after checking my problem in detail again, it seems like for me in v2 the problem was not the original-path metadata, but the pycache directory generated locally when installing the python dependencies for python lambda functions and layers using pip install -t in the DockerFile in Code.fromDockerBuild().
So my problem was not really related to this issue. |
What is the problem?
Since 1.134.0, a
Function
generates the metadata entryaws:asset:original-path
which includes the absolute path of the asset to be deployed. This information is system-dependent and therefore results in non-deterministic outputs.Please add your +1 👍 to let us know you have encountered this
Workaround
Use
--no-asset-metadata
or setassetMetadata: false
in yourcdk.json
.Status: IN PROGRESS
Original Issue
Since 1.134.0, a
Function
is starting to generate the metadata entryaws:asset:original-path
which relies on the full path of the asset to be deployed, but the path is definitely depending on the executor environment.I guess the relating change would be this.
Let's say we defined a
Function
construct like following:Then, if the source script path would be
/path/to/my-cdk/lib/my-stack.ts
then theaws:asset:original-path
would be/path/to/my-cdk/lambda/nice_function
.But when another operator tries to deploy this stack, and if the source script path located on
/foo/bar/my-cdk/lib/my-stack.ts
then theaws:asset:original-path
would claim it as/foo/bar/my-cdk/lambda/nice_function
...So we always face the differences when different operator hits
cdk diff
and even make a deployment when hittingcdk deploy
.It's very annoying...
Reproduction Steps
Create a stack containing a construct I described in "What is the problem?" section and hit
cdk diff
.What did you expect to happen?
No differences appear unless we made changes in the stack.
What actually happened?
So we almost always face the "differences" when different operators hit
cdk diff
and even make a deployment when hittingcdk deploy
.CDK CLI Version
1.134.0
Framework Version
No response
Node.js Version
v16.6.1
OS
macOS 11.6.1 (20G224)
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: