내용으로 건너뛰기

Aurora serverless, RDSDataService, executeStatement() API, " Unexpected key 'formatRecordsAs' found in params" error

1

Hello, I'm trying to add formatRecordsAs parameter to sqlParams for Aurora serverless RDSDataService (according to RDSDataService SDK) and getting "Unexpected key 'formatRecordsAs' found in params". Here is my code sample:

let sqlParams = {
        secretArn: storeArn.Value,
        resourceArn: dbArn.Value,
        database: dbSchema.Value,
        formatRecordsAs: 'JSON'
      };
sqlParams.sql = `select ...`;
let data = await RDS.executeStatement(sqlParams).promise();

Note that without "formatRecordsAs" parameter all works just fine. I double checked with RDSDataService SDK docs and didn't find any inconsistency in my code. What I might possibly missing here???

Thank you,

Victor.

질문됨 4년 전497회 조회

1개 답변
0

Hi, if you are using a lambda function, then the sdk version in use is 2.1055 at the time of this answer (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), and in this version 'formatRecordAs' parameter isn't supported.

As a workaround, you should create a lambda layer with a more recent sdk version (v3 is already available).

Hope this helps :)

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.