I'm using Lambda functions (Nodejs runtime) on my project and using some of the modules from aws-sdk.
So far, I've installed the entire aws-sdk and I'm requiring each package separately like this:
const ApiGatewayManagementApi = require('aws-sdk/clients/apigatewaymanagementapi');
This works, but the issue is that I need to install the entire aws-sdk, which is big, and thus makes my function package big.
Is there a way to only install the modules I will actually use?
I've tried this:
$ npm install aws-sdk/clients/apigatewaymanagementapi --save
Which gives me the following errors:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "aws-sdk/clients/apigatewaymanagementapi" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gustavocsdc/.npm/_logs/2019-05-16T02_32_28_129Z-debug.log