sparse-intern-71089
10/12/2022, 11:45 AMechoing-dinner-19531
10/12/2022, 11:58 AMrequireOutput
just returns an Output<any>
. But I think you should be able to type this as an Output<string[]>
able-afternoon-73080
10/12/2022, 12:40 PMexport data = ["some-string"]
Is being imported as
const data = stack.requireOutput("data");
console.log(data) // {string: "...", value: ["some-string"]}
Whereas the expected value of data should be ["some-string"]
echoing-dinner-19531
10/12/2022, 12:41 PMquiet-painter-30539
10/12/2022, 1:07 PMquiet-painter-30539
10/12/2022, 1:09 PMtype a_type = {string: string, "value": [string]};
a as unknown as pulumi.Output<a_type>;
echoing-dinner-19531
10/12/2022, 1:47 PMDoes that mean that for secrets we cannot convey the type information from stack A to stack B when using stack references?As above we never get type information across stacks, its all just untyped JSON.
What would be the right way to pass this kind of secret from one stack to another to avoid this:Output<string[]> should work here, if it's not that's a n SDK bug that we should go and look into.
able-afternoon-73080
10/12/2022, 2:10 PMThat’s because it’s secretI don’t understand why this makes any difference. I have never seen this behaviour when exporting any other kind of secret data, even other datatypes that are
string[]
- this is as if the JSON representation is getting transformed. Seems like a bug to me..able-afternoon-73080
10/12/2022, 2:12 PMpulumi stack output
then it’s correct. Why would pulumi modify this on the consuming stack?able-afternoon-73080
10/12/2022, 2:14 PMAs above we never get type information across stacks, its all just untyped JSON.I don’t think Kari is referring to the TypeScript type here - but rather the underlying structure of the data. I.e we don’t care that the output is Typed (in TS) as
Output<any>
but that the data itself is being mutated when compared to how it is exported from the source stackquiet-painter-30539
10/12/2022, 2:28 PMechoing-dinner-19531
10/12/2022, 2:48 PMbut that the data itself is being mutated when compared to how it is exported from the source stackThat is by design when the value is secret. As I said under the hood this just a JSON blob so there needs to be some way to indicate what bits are secret, that's done by wrapping the value in an object with the special key "4dabf18193072939515e22adb298388d" and value "1b47061264138c4ac30d75fd1eb44270". What's not by design is that your seeing that mutation, the SDK layer should have picked that up and translated it into a Output<string[]>.
echoing-dinner-19531
10/12/2022, 2:54 PMable-afternoon-73080
10/12/2022, 2:56 PMechoing-dinner-19531
10/12/2022, 3:47 PM