acceptable-stone-35112
04/28/2020, 3:28 PMboundless-airport-99052
04/28/2020, 7:46 PMacceptable-stone-35112
04/29/2020, 8:37 AMboundless-airport-99052
04/29/2020, 8:47 AMapply
by, the way, in typescript, I can’t do export
in a condition. I should be to the top level.
But, here is how I do:
import { StackReference } from "@pulumi/pulumi";
const stackRef = new StackReference(`${<http://config.org|config.org>}/${pulumi.getProject()}/infra`);
exports.infraStackName = stackRef.requireOutput("stack")
acceptable-stone-35112
04/29/2020, 12:34 PMif (pulumi.getStack() != "infra") {
exports.test = "123";
setImmediate(() => exports.test = "ABC");
while this one does:
(async () => {
exports.test = "ABC";
})();
boundless-airport-99052
04/29/2020, 12:53 PMAnd btw, exports do work inside conditions
e.g. following works fine in both if and switch case scopeAFAIK, it didn’t with typescript
in actual project I pass outputs from stack ref to components that in turn generate outputs of their own and I need to propagate all of them to stack outputI don’t understand what you do exactly but you don’t need to use
apply
when you use pulumi.Input
and `pulumi.Output`everywhere (including your components)acceptable-stone-35112
04/29/2020, 1:07 PM