Open jliburd-nsi opened 5 years ago
Yeah so serverless-bundle
explicitly excludes the aws-sdk
that you include and uses the one in Lambda. So this error makes sense. Usually Lambda adds support fairly quickly for new SDKs.
Ok. Thanks for the info.
It would be great if there was an option to explicitly include my local aws-sdk
as an external module, and include it in the bundle; I don't want to wait for AWS to decide when to update the SDK in the runtime, and I want to make sure that the SDK version I'm running in the Lambda environment is the same version I'm running locally.
Hmm that's interesting. We didn't have plans for this. But I'll reopen the issue and if other folks are running into this then we'll look into it.
@jayair It would be awesome to have a general support for configuring webpack excludes. I'm using puppeteer in a layer, and had found a trail through to a config like this:
custom:
webpack:
includeModules:
forceExclude:
- chrome-aws-lambda
(found by looking at serverless-webpack linked from the readme) - but that gives an error that the configs conflict — and I don't see another option)
Piggybacking on this issue as it seems to be semi related?
Oh that's interesting. Can you share more details on what you are trying to do? Possibly with a sample repo that I could try out?
Usually Lambda adds support fairly quickly for new SDKs.
Not quickly enough. It is At least 80 days old at this very moment (can't use SNS.publishBatch
yet)
I am trying to use the EventBridge client from aws-sdk. Lambda does not support the latest version of the SDK that has the EventBridge code. I included the latest version of aws-sdk in my package dependencies but when the code is bundled by serverless-bundle and deployed, I get an error stating "AWS.EventBridge is not a constructor". Am i doing something wrong? How do I include my own version of aws-sdk in lambda.
My code is:
`const AWS = require("aws-sdk"); const eventBridge = new AWS.EventBridge({ region: "us-east-1", apiVersion: "2015-10-07" });
..............`