Open
Description
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:
"Error: AWS CRT binary not present in any of the following locations:",
"\t/bin/linux-x64-glibc/aws-crt-nodejs",
" at node_modules/aws-crt/dist/native/binding.js (/var/task/index.js:781126:13)",
" at __require (/var/task/index.js:12:51)",
" at node_modules/aws-crt/dist/native/auth.js (/var/task/index.js:781569:38)",
" at __require (/var/task/index.js:12:51)",
" at node_modules/aws-crt/dist/index.js (/var/task/index.js:785169:30)",
" at __require (/var/task/index.js:12:51)",
" at node_modules/@aws-sdk/signature-v4-crt/dist-cjs/CrtSignerV4.js (/var/task/index.js:981809:21)",
" at __require (/var/task/index.js:12:51)",
" at node_modules/@aws-sdk/signature-v4-crt/dist-cjs/index.js (/var/task/index.js:981939:25)",
" at __require (/var/task/index.js:12:51)"
Reproduction Steps
- Install @aws-sdk/signature-v4-crt
- use signature-v4-crt for exmaple:
const sigV4 = new CrtSignerV4({
credentials: options.sigv4.credentials,
region: '*',
service: options.sigv4.service,
sha256: Sha256
})
const { method, headers, body } = await sigV4.sign(
{
method: requestInit.method,
headers: requestInit.headers,
protocol: 'https',
hostname: url.hostname,
path: `${url.pathname}?${url.search}`,
body: requestInit.body as string | undefined,
},
)
- Deploy code in a lambda function to Node18 runtime
- execute and it fails with the error above.
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