You should in generally not need to "capture" them, you should be able to just load them from "inside".
As a quite general point, it is worth trying to keep the amount of data that is captured by your automatic lambdas to a minimum.
The specifics here likely depend on how your code is structured - but I'd be surprised if you cannot accomplish what you want here by loading the desired librarires inside and capturing only "data" from the ambient environment.
b
boundless-monkey-50243
07/25/2019, 6:35 PM
I'm confused, at least from idiomatic TypeScript. Are you saying to
require()
them inside the lambda environment?
boundless-monkey-50243
07/25/2019, 6:37 PM
I must be misunderstanding the mechanism behind hoisting libraries (tbh I'm not even sure whether you call doing so capturing, hoisting, etc!). It's pretty magical. 😉
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.