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?

asked 2 years ago316 views
1 Answer
1
Accepted Answer

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
EXPERT
answered 2 years ago
  • Aah excellent, that solved the problem! Thank you so much

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