-
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
[assets] symlinks are always followed on publish, FollowMode has no effect #9251
Comments
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This is still a problem, as far as I can tell. I'm trying to deploy a single yarn workspace with its node_modules. Yarn gives workspaces a symlink to themselves (i.e. I guess solutions are to manually exclude the offending symlink if you don't need it in the options, or to create the zip file yourself. |
I am running into this issue as well. The CDK bundle contains symlinks but the zip file uploaded to lambda contains no symlinks and appears to have followed the symlinks when zipping, regardless of |
I am on cdk v2.85.0 and it seems like the I can confirm that zipping the contents of my folder is a workaround. |
to keep this alive: this issue can still be observed in cdk v2.141.0 |
It seems that while
FollowMode
is respected while copying assets tocdk.out
, it's not respected when publishing said assets to S3.A cursory glance at the packaging code shows why this is the case:
aws-cdk/packages/cdk-assets/lib/private/archive.ts
Lines 8 to 16 in dac9bb3
Both
nodir
andfollow
are hardcoded here and so usingFollowMode.NEVER
has no effect: symlinks are always followed when uploading to S3.Reproduction Steps
Create a
layer
directory that contains a file and a relative symlink to that file.Create a CDK stack containing:
Observe that in the asset directory in
cdk.out
, the symlink is preserved as is – it's a relative symlink that points to the file as it was when you created it.Observe that in the uploaded asset however, the symlink has been followed (ie, the file is duplicated in the layer, there is no symlink anymore). You can either do this by using the layer in a Lambda, or by simply downloading the zipfile asset that was published to S3 and listing its contents.
So there appears to be no way to upload layers (or functions) and preserve symlinks – unless you manually zip them yourselves. Which means
FollowMode
has no effect.Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: