Is it possible to export the same result twice under different names? #9408
-
For compatibility reasons I'm trying to export the same result value twice under different names. However, this does not seem to be possible as only one of the exports is actually created. Is this not possible? The following shows a minimal reproducible example of what I'm trying to do (not actually trying to export a password twice but it produces the same issue). My expectation would be that both
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Good question! This feels to me like it might be a bug. This works: ...
b = "some-string"
pulumi.export("export3", b)
pulumi.export("export4", b) ...
Outputs:
export1: [secret]
+ export3: "some-string"
+ export4: "some-string" As does running both outputs though ...
pulumi.export("export1", a.result.apply(lambda result: result))
pulumi.export("export2", a.result.apply(lambda result: result)) ...
Outputs:
export1: [secret]
+ export2: [secret] The equivalent program in TypeScript seems to work as well: import * as random from "@pulumi/random";
const a = new random.RandomPassword("A", {
length: 32,
});
export const export1 = a.result;
export const export2 = a.result; ...
Outputs:
export1: [secret]
export2: [secret] So I'm thinking unless this is probably worth filing a bug, as it does seem unexpected and inconsistent with other languages. I'm happy do to that (unless you'd like to). Let me know if the workaround above (with |
Beta Was this translation helpful? Give feedback.
Good question! This feels to me like it might be a bug. This works:
As does running both outputs though
apply
:The equivalent program in TypeScript seems to work as well: