dazzling-memory-8548
08/21/2020, 10:12 PMCallbackFunction
in order to take advantage of the automatic serialization (https://www.pulumi.com/docs/tutorials/aws/serializing-functions/). This works fine in most cases but starts to break down when we put resources in different modules. I have repository A
that contains my pulumi stack and resources, and a repository B
that contains shared pulumi Component
s and typescript helper functions in sub-modules.
If I create a CallbackFunction
in A
that uses a sub-module from B
, I run into `ImportModuleError`s, even if that sub-module in B
doesn't directly include any references to @pulumi/*
modules. It appears the serialization pulls in the entire B
module, rather than just the needed sub-module, causing the lambda to try to import erroneous pulumi libraries.
Situations like this seem to be correctly handled when all of the dependencies are in A
, but the serializer gets tripped up when a dependent module itself has pulumi dependencies.
Is this a potential bug in the serializer, or should I be using a different pattern to avoid this (split modules so they don't share pulumi code with vanilla lambda helpers)? Is there a way to ask the serializer to be more aggressive about inlining dependent code?
Thanks.
cc @worried-engineer-33884white-balloon-205
08/21/2020, 11:04 PMSituations like this seem to be correctly handled when all of the dependencies are inInteresting - and thanks for the details - it is certainly possible there is a bug here. Any chance you have a repro of this? Or have you opened a GitHub issue yet? Sounds like something we'll need to reproduce and diagnose in more depth., but the serializer gets tripped up when a dependent module itself has pulumi dependencies.A
dazzling-memory-8548
08/24/2020, 3:03 PM