sparse-intern-71089
04/28/2020, 3:28 PMboundless-airport-99052
04/28/2020, 7:46 PMboundless-airport-99052
04/28/2020, 7:46 PMacceptable-stone-35112
04/29/2020, 8:37 AMacceptable-stone-35112
04/29/2020, 8:42 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")
boundless-airport-99052
04/29/2020, 8:48 AMacceptable-stone-35112
04/29/2020, 12:34 PMacceptable-stone-35112
04/29/2020, 12:34 PMacceptable-stone-35112
04/29/2020, 12:35 PMacceptable-stone-35112
04/29/2020, 12:36 PMacceptable-stone-35112
04/29/2020, 12:38 PMif (pulumi.getStack() != "infra") {
exports.test = "123";
acceptable-stone-35112
04/29/2020, 12:39 PMacceptable-stone-35112
04/29/2020, 12:52 PMsetImmediate(() => 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
boundless-airport-99052
04/29/2020, 12:54 PMin 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 PMacceptable-stone-35112
04/29/2020, 1:11 PMacceptable-stone-35112
04/29/2020, 1:12 PM