-
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
synthetics-alpha: Asset not found when Canary belongs to Stage #27089
Comments
A few minor questions:
|
@indrora Thank you for responding.
Yes. It can be synthesized successfully with same code in
Same error occurs with using it. Without Stage, synthesized successfully. code: synthetics.Code.fromAsset(path.join(__dirname, '../../lambda/canary-app')), Also, I think other assets are able to synthesize without |
I was able to reproduce this. Curious behavior. Hopefully I can find a fix soon, but thanks for reporting.
|
#27167) Fixes #27089. Canaries inside stages would fail at synth time after #26291 was introduced. This was due to a misunderstanding of `assetOutdir`. It turns out that `this.asset.assetPath` is a relative path of `Stage.of(scope).outdir`, not of `Stage.of(scope).assetOutdir`. These two out directories would be equivalent at the root level, but if there were nested stages, `assetOutdir` would equal `../${outdir}`. This diagram may help: ``` CLOUD ASSEMBLY ROOT +-- asset.12345abcdef/ +-- assembly-Stage +-- MyStack.template.json +-- MyStack.assets.json <- will contain { "path": "../asset.12345abcdef" } ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
#27167) Fixes #27089. Canaries inside stages would fail at synth time after #26291 was introduced. This was due to a misunderstanding of `assetOutdir`. It turns out that `this.asset.assetPath` is a relative path of `Stage.of(scope).outdir`, not of `Stage.of(scope).assetOutdir`. These two out directories would be equivalent at the root level, but if there were nested stages, `assetOutdir` would equal `../${outdir}`. This diagram may help: ``` CLOUD ASSEMBLY ROOT +-- asset.12345abcdef/ +-- assembly-Stage +-- MyStack.template.json +-- MyStack.assets.json <- will contain { "path": "../asset.12345abcdef" } ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When using
Canary
with custom test code asset in Stage, CDK fails to synthesize.Expected Behavior
Successfully synthesized with code asset.
Current Behavior
Fail to synshesize with error:
Reproduction Steps
1/ Make sure successfully synthesized Canary without Stage
2/ Add Stage and make the Stack belong to it
Full code
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.94.0 (build 987c329)
Framework Version
No response
Node.js Version
v18.17.1
OS
macOS Ventura 13.5.2(22G91)
Language
Typescript
Language Version
TypeScript 5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: