https://pulumi.com logo
Title
b

bright-intern-41366

04/28/2021, 9:51 AM
I tried to add package to 
Lambda
 function with Pulumi, however, I only found a way to add, only if package is a 
node_modue.
  Is there anyway to add package outside of 
node_modules .
I  cannot use 
new pulumi.asset.FileArchive("./file.zip")
  since I write code inside 
new aws.lambda.CallbackFunction()
 . Any help guys..
d

damp-school-17708

04/28/2021, 11:24 AM
we use webpack and merge all the dependencies in one single file. it seems to be the best option also minify and have an optional size. Before we used to copy dependencies in the build folder and then point pulumi there.
b

bright-intern-41366

04/29/2021, 6:55 AM
@damp-school-17708 You mean you dont compile with pulumi , instead of that you use webpack then the file will upload to AWS by using pulumi
'new pulumi.asset.FileArchive("./file.zip")'
.
d

damp-school-17708

04/29/2021, 7:37 AM
yep
I pass the folder though
b

bright-intern-41366

04/29/2021, 8:01 AM
got it thank you
@damp-school-17708 I guess I use
serverless
for Lambda and provision with
Pulumi
,
Serverless
got a lot of plugins as well
d

damp-school-17708

04/29/2021, 10:48 AM
those are two different things, serverless framework leverages cloudformation (behind the scenes generates a cloudformation template, at least in AWS), pulumi calls AWS api via Terraform afaik
so you can't really use the two together (Afaik)