Hello Everyone - I am trying to understand how sho...
# aws
b
Hello Everyone - I am trying to understand how should I write the runtime code of AWS lambda in Pulumi. I have a code which consists of several user-defined modules in typescript. However, when I try to deploy the lambda using pulumi, the whole deployment process is stuck in the preview phase. I did read the documentation regarding function serialization in https://www.pulumi.com/docs/intro/concepts/function-serialization/ however I didn't quite understand what I should or should not do when approaching the task of writing a lambda code. What modules can I import? Should they only come from folder node_modules? Can these modules import other user-defined modules themselves? Can I write the code in TypeScript entirely (i.e. using enums, classes, interfaces etc.) ?   Can one of you guys shed a bit more light on how to do this task?   Thank you all!
m
you seem to have a much more complicated example, mine was simple otoh I know it is working as I deployed it just today - providing a link ymmv - https://github.com/maddalab/pgar/blob/main/index.ts#L143
do you have an error that you can share?
b
unfortunately no. the deployment process just seems to hang for no reason. when i comment out all of the resources relevant for this lambda (including the lambda itself) everything goes back to normal. i can't seem to find out what causes this
i am truly convinced it's related to some function serialization process involved which "goes out of order" when the runtime code consists of multiple user-defined modules
m
got it.
b
who do you think can help me out here? even now as we speak the update run is stuck because of this. i don't know how to write the code in a way which will enable pulumi to serialize my function
m
unfortunately I don't know individuals, like you I am an end user who asks questions here. I'm sure there is someone who can, it's relatively early in the western hemisphere, hang in there and experiment (smaller code size?). Sorry to not be of any assistance
b
Thank you!