Dynamic require of \"buffer\" is not supported #6670
Unanswered
ALbert-Shen-code
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use @aws-sdk/rds-signer to contact with rds, this is my code:
`
import cors from '@middy/http-cors';
import jsonBodyParser from '@middy/http-json-body-parser';
import middy from '@middy/core';
import rdsSigner, { RdsSignerOptions } from '@middy/rds-signer';
import { Signer } from '@aws-sdk/rds-signer';
import { lambdaHandler, rdsConfig } from './handler';
import inputOutputLogger from '@middy/input-output-logger';
import ssm from '@middy/ssm';
import { logger } from '../utils';
export const handler = middy()
.use(
inputOutputLogger({
logger: (request) => logger.debug(request.event ?? request.response),
})
)
.use(
ssm({
fetchData: { jwtPrivateKey: process.env.PRIVATE_KEY_PARAM },
setToContext: true,
})
)
.use(jsonBodyParser())
.use(rdsSigner(rdsConfig() as RdsSignerOptions ))
.use(
cors({
origins: [
https://${process.env.DOMAIN}
,https://*.${process.env.DOMAIN}
,],
credentials: true,
})
)
.handler(lambdaHandler);
`
But I got error from aws lambda like this:
Can anyone help me with it?
my aws-sdk/rds-signer is 3.654.0
Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions