Closed nickmeldrum closed 5 years ago
my function code when deployed is wrapped in a folder with the same name as the generated lambda function name.
If I understand correctly - this is just part of how Lambda works - the function runs inside a folder named after the function.
Is there something else going on here that you believe is specific to Pulumi?
If so, a repro of that could help. Feel free to reopen
I can't work out what my handler should be as the folder name is generated?
Note that the folder name should not impact this at all - index.handler
refers to the file and exported function. You should not have to guess the name.
Yes you are absolutely right thanks - I had got myself confused as to whether I was using the FileAsset/ AssetArchives correctly as when I invoked the lambda I got handler not found - but it was just because I had moved my lambda from TypeScript to JavaScript and forgotten to change my export line back from ES modules to commonjs!
On that subject by the way - any good examples/ tutorials explaining the subtleties of the various Asset classes and how they work?
Thanks for your response though!
I am trying to set up a lambda in pulumi-aws but my function code when deployed is wrapped in a folder with the same name as the generated lambda function name.
I would prefer not to have this as it's unnecessary, but more than that it means I can't work out what my handler should be as the folder name is generated?
E.g. my function code is 1 simple
index.js
file. with 1 named export ofhandler
. I would expect my lambda handler to beindex.handler
.(Note I am using TypeScript for my pulumi code but the Lambda is in JavaScript.)
I have tried various options for the code property:
In this example the zip file was simply an index.js with no folder information in the zip.