Lambda中无法使用Textract的AnalyseId

0

【以下的问题经过翻译处理】 Textract中的新函数AnalyzeID在Lambda中可以用了么?在Lambda和SAM中,我都遇到了这个错误:

Textract.analyzeID is not a function

const AWS = require('aws-sdk');
const Textract = new AWS.Textract();

exports.handler = async (event, context) => {
      Textract.analyzeID(params, function(err, data) {
        ...
      });
};

但是当我在空项目中运行类似的代码时,代码可以正常工作,我想知道这个报错是否与Lambda/SAM容器有关?

profile picture
EXPERT
asked 9 months ago8 views
1 Answer
0

【以下的回答经过翻译处理】 我怀疑您使用的是旧版本的 AWS SDK,它没有您尝试使用的功能。请确保与您的 Lambda 函数打包在一起的是正确的AWS SDK版本。参见:https://aws.amazon.com/premiumsupport/knowledge-center/lambda-layer-aws-sdk-latest-version/

profile picture
EXPERT
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions