This message was deleted.
# general
s
This message was deleted.
m
If I understand https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/runtime/closure/codePaths.ts properly, there is no way to achieve what I need 🙄 If that's right, what workaround could help ? (without this, I'm blocked in a project as a lambda keeps failing because of this)
Simply adding
codePathOptions: { extraExcludePackages: ['awk-sdk'] }
doesn't change a thing
d
I use the other way to define functions, so things might be a bit different. However, aws-sdk should generally be a dev dependency, you don't need that once you deploy the lambda as it's available in the lambda environment, I'd put it on the dev Dependencies. We write typescript lambdas, so we use a package to copy node_modules over to the builds folder and deploy that. I am keen to hear what else people are doing to efficiently package and deploy lambdas
copy-node-modules
is our trick to copy the deps
it has options to avoid dev deps
actually the other way around, the default is to do not copy over dev deps, that makes sense
m
Thanks for your reply @damp-school-17708 🙂 I actually went the same way : I've moved aws-sdk as a devDep, so Pulumi stops embedding it in the lambda package (so we can use the aws-provided aws-sdk). This works fine for me so far. Out of curiosity: how to you integrate copy-node-modules with your pulumi code? you bypass all pulumi lambda packaging features and delegate everything to copy-node-modules?
d
what we do is use codebuild/codepipeline, so in the buidspec for that lambda project I run yarn install && yarn build, yarn build calls the npm package to copy over the node_modules
m
oh, ok, you manage CICD with Pulumi, but you deploy your Lambdas from your CICD. I may do this at some point.