Open justin-masse opened 10 months ago
My gut feeling is this has something to do with this code in binding.js --
let binding;
for (const path of search_paths) {
if ((0, fs_1.existsSync)(path + '.node')) {
binding = require(path);
break;
}
}
but i'm working on verifying that by giving require() a direct path to the binary in my lambda. This will possibly confirm that this is broken when the node module gets hoisted out of signature-v4-crt and into root.
Somewhat relevant: https://github.com/awslabs/aws-crt-nodejs/pull/490
Somewhat relevant: #490
yeah, something like that might work. I am having trouble getting the path because process.cwd() is /var/task on lambda so i'm going to try to force the aws-crt pkg binary into where it is "expected" and see if that works.
It might be worthwhile for the sigv4-crt package to just include the binaries as well but that seems like overkill.
This also appears to be happening on my lambda when using the implementation with just aws-crt and running crt.auth.sign()
So just wanted to reiterate the problem here, this is a problem with the relative pathing to the nodejs binaries within the aws-crt package. This breaks when using esbuild/webpack.
I was able to workaround this by doing the following:
--external:aws-crt
to my esbuild command so it would reference the code in the lambda layer that was not being built with webpack/esbuild.This is a very annoying process to have to update our lambdas to use aws-crt as a layer instead of being able to bake it in with the multi-region signing npm package on top of having to update all of our services to mark it as an external package within esbuild.
Any update? Will this support webpack/esbuild anytime soon?
Describe the bug
When using @aws-sdk/signature-v4-crt it is getting an error that AWS CRT binary not present in any of the following locations:
I have verified the aws-crt package is present and I can see the binary in bin/linux-x64-glibc as aws-crt-nodejs.node. The problem is that it gets hoisted to the top level of node_modules by yarn instead of living under sigv4 package.
Runtime is AWS Lambda Node18
Expected Behavior
Not to get this error
Current Behavior
When using sigv4 CRT signing methods it gives error:
Reproduction Steps
use signature-v4-crt for exmaple:
Possible Solution
No response
Additional Information/Context
No response
aws-crt-nodejs version used
1.18.3
nodejs version used
18
Operating System and version
linux2