AWS lambda function error – Unable to import module ‘index’: Error

Unable to import module ‘index’: Error It looks like some of your dependencies are installed / not packaged correctly. Delete the node_modules directory and re-install the module with npm install should fix the issue. Make sure your function get packaged as mentioned in the doc https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html If your bundle missed a node_module, then it will result in this … Read more

AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

This error is common if you try to deploy a Lambda in a VPC without giving it the required network interface related permissions ec2:DescribeNetworkInterfaces, ec2:CreateNetworkInterface, and ec2:DeleteNetworkInterface (see AWS Forum). For example, this a policy that allows to deploy a Lambda into a VPC:

tech