The application itself is a Lambda handler written in Node. After "npm update", some of the sub-dependencies, babel?, is most likely interfering and doing something that have changed.
Our AWS code is initialised in one module looking like this:
const AWS = require('aws-sdk')
AWS.config.update({
accessKeyId: process.env.AWS_ACCESSKEY_ID,
secretAccessKey: process.env.AWS_ACCESSKEY_SECRET,
region: process.env.AWS_REGION
})
module.exports= {
s3: new AWS.S3(),
dynamodb: new AWS.DynamoDB({ apiVersion: '2012-08-10' }),
<more similar exports>
}
module.exports.default = AWS
As soon as I try to mock a method on a service, I get an error related to that service:
TypeError: AWS.DynamoDB is not a constructor