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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南