Textract AnalyseId not working / available on Lambda

0

Is it possible that the new Textract AnalyzeID function is not available in Lambda yet? In both Lambda and SAM I get this error:

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) {
        ...
      });
};

When I run the similar code in an empty project locally it works, making me wondering if its something to do with the Lambda/SAM container?

已提问 2 年前320 查看次数
1 回答
1
已接受的回答

I suspect that you are using an older version of the AWS SDK that doesn't have the function you're trying to use. Make sure your Lambda function is packaged with an appropriate AWS SDK version. You can find some instructions here: https://aws.amazon.com/premiumsupport/knowledge-center/lambda-layer-aws-sdk-latest-version/

profile pictureAWS
专家
已回答 2 年前
  • Aah excellent, that solved the problem! Thank you so much

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则